autosave on undo/redo

This commit is contained in:
ramnique 2025-02-05 16:49:48 +05:30
parent 64fddb63c2
commit 58d3c5eebb

View file

@ -149,6 +149,8 @@ function reducer(state: State, action: Action): State {
const inverse = state.inversePatches[state.currentIndex - 1];
draft.present = applyPatches(state.present, inverse);
draft.currentIndex--;
draft.present.pendingChanges = true;
draft.present.chatKey++;
});
break;
}
@ -158,6 +160,8 @@ function reducer(state: State, action: Action): State {
const patch = state.patches[state.currentIndex];
draft.present = applyPatches(state.present, patch);
draft.currentIndex++;
draft.present.pendingChanges = true;
draft.present.chatKey++;
});
break;
}