mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
add history.shouldCreateEntry resolver (#1622)
This commit is contained in:
parent
22f7945c70
commit
d2ae18995c
11 changed files with 1349 additions and 3449 deletions
|
@ -276,12 +276,23 @@ class App extends React.Component<any, AppState> {
|
|||
if (res.commitToHistory) {
|
||||
history.resumeRecording();
|
||||
}
|
||||
this.setState((state) => ({
|
||||
...res.appState,
|
||||
editingElement: editingElement || res.appState?.editingElement || null,
|
||||
isCollaborating: state.isCollaborating,
|
||||
collaborators: state.collaborators,
|
||||
}));
|
||||
this.setState(
|
||||
(state) => ({
|
||||
...res.appState,
|
||||
editingElement:
|
||||
editingElement || res.appState?.editingElement || null,
|
||||
isCollaborating: state.isCollaborating,
|
||||
collaborators: state.collaborators,
|
||||
}),
|
||||
() => {
|
||||
if (res.syncHistory) {
|
||||
history.setCurrentState(
|
||||
this.state,
|
||||
globalSceneState.getElementsIncludingDeleted(),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue