diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/DnDWrapper/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/DnDWrapper/index.jsx index 224ac4c7d..e40f75001 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/DnDWrapper/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/DnDWrapper/index.jsx @@ -161,7 +161,8 @@ export function DnDFileUploaderProvider({ workspace, children }) { } export default function DnDFileUploaderWrapper({ children }) { - const { onDrop, ready, dragging, setDragging } = useContext(DndUploaderContext); + const { onDrop, ready, dragging, setDragging } = + useContext(DndUploaderContext); const { getRootProps, getInputProps } = useDropzone({ onDrop, disabled: !ready, diff --git a/frontend/src/hooks/useImagePaste.js b/frontend/src/hooks/useImagePaste.js index 8a800644f..e5dddb00e 100644 --- a/frontend/src/hooks/useImagePaste.js +++ b/frontend/src/hooks/useImagePaste.js @@ -1,14 +1,17 @@ -import { useEffect } from 'react'; +import { useEffect } from "react"; export function useImagePaste(onImagePaste) { useEffect(() => { const handlePaste = (e) => { const items = e.clipboardData.items; for (let i = 0; i < items.length; i++) { - if (items[i].type.indexOf('image/') !== -1) { + if (items[i].type.indexOf("image/") !== -1) { e.preventDefault(); const blob = items[i].getAsFile(); - const fileName = blob.name !== "image.png" ? blob.name : `pasted-image.${blob.type.split('/')[1]}`; + const fileName = + blob.name !== "image.png" + ? blob.name + : `pasted-image.${blob.type.split("/")[1]}`; const file = new File([blob], fileName, { type: blob.type }); onImagePaste(file); break; @@ -16,9 +19,9 @@ export function useImagePaste(onImagePaste) { } }; - document.addEventListener('paste', handlePaste); + document.addEventListener("paste", handlePaste); return () => { - document.removeEventListener('paste', handlePaste); + document.removeEventListener("paste", handlePaste); }; }, [onImagePaste]); -} \ No newline at end of file +}