consider start & after load as saved
This commit is contained in:
parent
1f243efc5f
commit
939c402cb4
@ -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"}]
|
||||
[{"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"}]
|
@ -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<boolean>(true);
|
||||
const [savedLines, setSavedLines] = useState<ColoredLine[]>(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] =
|
||||
|
Loading…
Reference in New Issue
Block a user