diff --git a/saves/gridlines.json b/saves/gridlines.json index 234fae9..fbe55c4 100644 --- a/saves/gridlines.json +++ b/saves/gridlines.json @@ -1 +1 @@ -[{"x0":500,"y0":680,"x1":1080,"y1":360,"stroke":"#007acc"},{"x0":620,"y0":300,"x1":1100,"y1":720,"stroke":"#007acc"},{"x0":420,"y0":480,"x1":780,"y1":740,"stroke":"#007acc"}] \ No newline at end of file +[{"x0":480,"y0":600,"x1":880,"y1":420,"stroke":"#007acc"},{"x0":480,"y0":340,"x1":780,"y1":700,"stroke":"#007acc"},{"x0":300,"y0":540,"x1":660,"y1":360,"stroke":"#007acc"},{"x0":380,"y0":380,"x1":480,"y1":760,"stroke":"#007acc"}] \ No newline at end of file diff --git a/src/components/grid/grid-config.tsx b/src/components/grid/grid-config.tsx index cf933b9..06a0031 100644 --- a/src/components/grid/grid-config.tsx +++ b/src/components/grid/grid-config.tsx @@ -13,6 +13,7 @@ import { startPointState, DrawMode, drawModePreClipboardState, + ColoredLine, } from '../../atoms'; import './grid-config.scss'; @@ -320,9 +321,10 @@ const StateConfig: FC = () => { null ); const [saved, setSaved] = useState(true); + const [savedLines, setSavedLines] = useState(lines); useEffect(() => { - setSaved(false); - }, [lines]); + setSaved(lines === savedLines); + }, [lines, savedLines]); const [onOpen, onOpenErrShaking, onOpenPending] = useAsyncVoidCallback(async () => { @@ -339,6 +341,9 @@ const StateConfig: FC = () => { ]); setRedoActions([]); setStartPoint(null); + + setSaved(true); + setSavedLines(newLines); }, []); const [onSave, onSaveErrShaking, onSavePending] =