mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-03 23:57:01 +02:00
History improvements (#337)
* Simplified redoOnce. * Help mental model. * Move clear redo stack where it belongs. * Not needed anymore as we check for same state.
This commit is contained in:

committed by
Christopher Chedeau

parent
ba8bc10431
commit
88a9cee8bb
@@ -291,7 +291,7 @@ export class App extends React.Component<{}, AppState> {
|
||||
} else if (event[META_KEY] && event.code === "KeyZ") {
|
||||
if (event.shiftKey) {
|
||||
// Redo action
|
||||
const data = history.redoOnce(elements);
|
||||
const data = history.redoOnce();
|
||||
if (data !== null) {
|
||||
elements = data;
|
||||
}
|
||||
@@ -1026,7 +1026,6 @@ export class App extends React.Component<{}, AppState> {
|
||||
this.saveDebounced();
|
||||
if (history.isRecording()) {
|
||||
history.pushEntry(history.generateCurrentEntry(elements));
|
||||
history.clearRedoStack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user