mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: support updating appState in updateScene API (#3576)
* feat: support updating appState in updateScene API * make `updateScene.data.appState` more type-safe * restore `appState` when passing to `updateScene` * fix Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
f1cf28a84e
commit
78da4c075e
5 changed files with 29 additions and 21 deletions
|
@ -51,7 +51,7 @@ import {
|
|||
saveToLocalStorage,
|
||||
} from "./data/localStorage";
|
||||
import CustomStats from "./CustomStats";
|
||||
import { RestoredDataState } from "../data/restore";
|
||||
import { restoreAppState, RestoredDataState } from "../data/restore";
|
||||
|
||||
const languageDetector = new LanguageDetector();
|
||||
languageDetector.init({
|
||||
|
@ -239,7 +239,10 @@ const ExcalidrawWrapper = () => {
|
|||
} else {
|
||||
initializeScene({ collabAPI }).then((scene) => {
|
||||
if (scene) {
|
||||
excalidrawAPI.updateScene(scene);
|
||||
excalidrawAPI.updateScene({
|
||||
...scene,
|
||||
appState: restoreAppState(scene.appState, null),
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue