feat: library restoring changes (#4995)

* restore library items in all cases & refactor

* export `restoreLibraryItems` from package

* feat: rerender library menu when updating via API

* update readme & changelog

* fix changelog
This commit is contained in:
David Luzar 2022-04-14 16:20:35 +02:00 committed by GitHub
parent bf6d0eeef7
commit 70b3a9de49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 71 additions and 29 deletions

View file

@ -1700,6 +1700,11 @@ class App extends React.Component<AppProps, AppState> {
this.library.saveLibrary(
restoreLibraryItems(sceneData.libraryItems, "unpublished"),
);
if (this.state.isLibraryOpen) {
this.setState({ isLibraryOpen: false }, () => {
this.setState({ isLibraryOpen: true });
});
}
}
},
);