From 16c94eb9737e606acd2146bed1fe054adc90b835 Mon Sep 17 00:00:00 2001 From: vcoppe Date: Tue, 30 Apr 2024 22:43:06 +0200 Subject: [PATCH] fix can undo --- website/src/lib/filestore.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/src/lib/filestore.ts b/website/src/lib/filestore.ts index ac48d1f1..87a2c361 100644 --- a/website/src/lib/filestore.ts +++ b/website/src/lib/filestore.ts @@ -66,12 +66,14 @@ export function createGPXFileStore(): GPXFileStore { if (patchIndex >= 0) { applyPatch(patches[patchIndex].inversePatch, patches[patchIndex].global); patchIndex--; + updateUndoRedo(); } }, redo: () => { if (patchIndex < patches.length - 1) { patchIndex++; applyPatch(patches[patchIndex].patch, patches[patchIndex].global); + updateUndoRedo(); } }, }); @@ -90,7 +92,6 @@ export function createGPXFileStore(): GPXFileStore { if (global) { notify(); } - updateUndoRedo(); } function applyToGlobalStore(callback: (files: Map) => void) {