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:
@ -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"),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user