feat: support updating library in updateScene API (#4546)

* feat: support updating library in updateScene API

* fix

* update docs

* Update src/packages/excalidraw/CHANGELOG.md
This commit is contained in:
Aakansha Doshi 2022-01-06 21:37:33 +05:30 committed by GitHub
parent 5f1616f2c5
commit b475412199
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 9 deletions

View file

@ -1582,6 +1582,7 @@ class App extends React.Component<AppProps, AppState> {
appState?: Pick<AppState, K> | null;
collaborators?: SceneData["collaborators"];
commitToHistory?: SceneData["commitToHistory"];
libraryItems?: SceneData["libraryItems"];
}) => {
if (sceneData.commitToHistory) {
this.history.resumeRecording();
@ -1598,6 +1599,12 @@ class App extends React.Component<AppProps, AppState> {
if (sceneData.collaborators) {
this.setState({ collaborators: sceneData.collaborators });
}
if (sceneData.libraryItems) {
this.library.saveLibrary(
restoreLibraryItems(sceneData.libraryItems, "unpublished"),
);
}
},
);