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]; const inverse = state.inversePatches[state.currentIndex - 1];
draft.present = applyPatches(state.present, inverse); draft.present = applyPatches(state.present, inverse);
draft.currentIndex--; draft.currentIndex--;
draft.present.pendingChanges = true;
draft.present.chatKey++;
}); });
break; break;
} }
@ -158,7 +160,9 @@ function reducer(state: State, action: Action): State {
const patch = state.patches[state.currentIndex]; const patch = state.patches[state.currentIndex];
draft.present = applyPatches(state.present, patch); draft.present = applyPatches(state.present, patch);
draft.currentIndex++; draft.currentIndex++;
}); draft.present.pendingChanges = true;
draft.present.chatKey++;
});
break; break;
} }
case "update_workflow_name": { case "update_workflow_name": {