diff --git a/web_app/package-lock.json b/web_app/package-lock.json index c553fb7..f792bdd 100644 --- a/web_app/package-lock.json +++ b/web_app/package-lock.json @@ -57,7 +57,7 @@ "devDependencies": { "@tanstack/eslint-plugin-query": "^5.8.4", "@types/axios": "^0.14.0", - "@types/flexsearch": "^0.7.3", + "@types/flexsearch": "^0.7.6", "@types/lodash": "^4.14.201", "@types/node": "^20.9.2", "@types/react": "^18.2.37", diff --git a/web_app/package.json b/web_app/package.json index 0ba3ac3..acecaf8 100644 --- a/web_app/package.json +++ b/web_app/package.json @@ -59,7 +59,7 @@ "devDependencies": { "@tanstack/eslint-plugin-query": "^5.8.4", "@types/axios": "^0.14.0", - "@types/flexsearch": "^0.7.3", + "@types/flexsearch": "^0.7.6", "@types/lodash": "^4.14.201", "@types/node": "^20.9.2", "@types/react": "^18.2.37", diff --git a/web_app/src/App.tsx b/web_app/src/App.tsx index c591a5c..e1560f2 100644 --- a/web_app/src/App.tsx +++ b/web_app/src/App.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useMemo, useRef, useState } from "react" +import { useCallback, useEffect, useMemo, useRef } from "react" import { nanoid } from "nanoid" import useInputImage from "@/hooks/useInputImage" @@ -56,7 +56,6 @@ function Home() { return nanoid() }, [file]) - const [isDragging, setIsDragging] = useState(false) const dragCounter = useRef(0) const handleDrag = useCallback((event: any) => { @@ -68,9 +67,6 @@ function Home() { event.preventDefault() event.stopPropagation() dragCounter.current += 1 - if (event.dataTransfer.items && event.dataTransfer.items.length > 0) { - setIsDragging(true) - } }, []) const handleDragOut = useCallback((event: any) => { @@ -78,13 +74,11 @@ function Home() { event.stopPropagation() dragCounter.current -= 1 if (dragCounter.current > 0) return - setIsDragging(false) }, []) const handleDrop = useCallback((event: any) => { event.preventDefault() event.stopPropagation() - setIsDragging(false) if (event.dataTransfer.files && event.dataTransfer.files.length > 0) { if (event.dataTransfer.files.length > 1) { // setToastState({ diff --git a/web_app/src/components/Coffee.tsx b/web_app/src/components/Coffee.tsx index 16b110d..c674f54 100644 --- a/web_app/src/components/Coffee.tsx +++ b/web_app/src/components/Coffee.tsx @@ -1,12 +1,5 @@ import { Coffee as CoffeeIcon } from "lucide-react" -import { - Dialog, - DialogContent, - DialogFooter, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "./ui/dialog" +import { Dialog, DialogContent, DialogTitle, DialogTrigger } from "./ui/dialog" import { IconButton } from "./ui/button" import { DialogDescription } from "@radix-ui/react-dialog" import Kofi from "@/assets/kofi_button_black.png" diff --git a/web_app/src/components/Cropper.tsx b/web_app/src/components/Cropper.tsx index 2d4554b..b80c81b 100644 --- a/web_app/src/components/Cropper.tsx +++ b/web_app/src/components/Cropper.tsx @@ -214,7 +214,7 @@ const Cropper = (props: Props) => { } } - const onPointerDone = (e: PointerEvent) => { + const onPointerDone = () => { if (isResizing) { setIsResizing(false) } diff --git a/web_app/src/components/Editor.tsx b/web_app/src/components/Editor.tsx index 225d0f0..76205c9 100644 --- a/web_app/src/components/Editor.tsx +++ b/web_app/src/components/Editor.tsx @@ -703,7 +703,7 @@ export default function Editor(props: EditorProps) { doubleClick={{ disabled: true }} initialScale={minScale} minScale={minScale * 0.3} - onPanning={(ref) => { + onPanning={() => { if (!panned) { setPanned(true) } diff --git a/web_app/src/components/Extender.tsx b/web_app/src/components/Extender.tsx index dacb85e..a2d5cf9 100644 --- a/web_app/src/components/Extender.tsx +++ b/web_app/src/components/Extender.tsx @@ -209,7 +209,7 @@ const Extender = (props: Props) => { } } - const onPointerDone = (e: PointerEvent) => { + const onPointerDone = () => { if (isResizing) { setIsResizing(false) } diff --git a/web_app/src/components/Header.tsx b/web_app/src/components/Header.tsx index bee1482..1b4ae5a 100644 --- a/web_app/src/components/Header.tsx +++ b/web_app/src/components/Header.tsx @@ -1,5 +1,5 @@ import { PlayIcon } from "@radix-ui/react-icons" -import { useCallback, useState } from "react" +import { useState } from "react" import { IconButton, ImageUploadButton } from "@/components/ui/button" import Shortcuts from "@/components/Shortcuts" import { useImage } from "@/hooks/useImage" diff --git a/web_app/src/components/InteractiveSeg.tsx b/web_app/src/components/InteractiveSeg.tsx index 9a140aa..d540708 100644 --- a/web_app/src/components/InteractiveSeg.tsx +++ b/web_app/src/components/InteractiveSeg.tsx @@ -119,11 +119,6 @@ const InteractiveSegPoints = () => { } const InteractiveSeg = () => { - const [interactiveSegState, updateInteractiveSegState] = useStore((state) => [ - state.interactiveSegState, - state.updateInteractiveSegState, - ]) - return (