mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-02 08:42:31 +00:00
fix can undo
This commit is contained in:
@@ -66,12 +66,14 @@ export function createGPXFileStore(): GPXFileStore {
|
|||||||
if (patchIndex >= 0) {
|
if (patchIndex >= 0) {
|
||||||
applyPatch(patches[patchIndex].inversePatch, patches[patchIndex].global);
|
applyPatch(patches[patchIndex].inversePatch, patches[patchIndex].global);
|
||||||
patchIndex--;
|
patchIndex--;
|
||||||
|
updateUndoRedo();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
redo: () => {
|
redo: () => {
|
||||||
if (patchIndex < patches.length - 1) {
|
if (patchIndex < patches.length - 1) {
|
||||||
patchIndex++;
|
patchIndex++;
|
||||||
applyPatch(patches[patchIndex].patch, patches[patchIndex].global);
|
applyPatch(patches[patchIndex].patch, patches[patchIndex].global);
|
||||||
|
updateUndoRedo();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -90,7 +92,6 @@ export function createGPXFileStore(): GPXFileStore {
|
|||||||
if (global) {
|
if (global) {
|
||||||
notify();
|
notify();
|
||||||
}
|
}
|
||||||
updateUndoRedo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyToGlobalStore(callback: (files: Map<string, GPXFile>) => void) {
|
function applyToGlobalStore(callback: (files: Map<string, GPXFile>) => void) {
|
||||||
|
Reference in New Issue
Block a user