mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
Fix three rendering when loading (#986)
The problem is that syncActionResult wasn't using batching.
This commit is contained in:
parent
e9f5175f51
commit
0dc07135b7
1 changed files with 21 additions and 22 deletions
|
@ -186,10 +186,8 @@ export class App extends React.Component<any, AppState> {
|
||||||
this.actionManager.registerAction(createRedoAction(history));
|
this.actionManager.registerAction(createRedoAction(history));
|
||||||
}
|
}
|
||||||
|
|
||||||
private syncActionResult = (
|
private syncActionResult = withBatchedUpdates(
|
||||||
res: ActionResult,
|
(res: ActionResult, commitToHistory: boolean = true) => {
|
||||||
commitToHistory: boolean = true,
|
|
||||||
) => {
|
|
||||||
if (this.unmounted) {
|
if (this.unmounted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -210,7 +208,8 @@ export class App extends React.Component<any, AppState> {
|
||||||
collaborators: state.collaborators,
|
collaborators: state.collaborators,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
);
|
||||||
|
|
||||||
private onCut = withBatchedUpdates((event: ClipboardEvent) => {
|
private onCut = withBatchedUpdates((event: ClipboardEvent) => {
|
||||||
if (isWritableElement(event.target)) {
|
if (isWritableElement(event.target)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue