Allow updating name on updateScene

This commit is contained in:
Arun Kumar 2021-03-18 01:04:02 +05:30
parent c1379c3c10
commit 4e07a608d3
1 changed files with 12 additions and 5 deletions

View File

@ -1309,12 +1309,19 @@ class App extends React.Component<ExcalidrawProps, AppState> {
history.resumeRecording();
}
// currently we only support syncing background color
if (sceneData.appState?.viewBackgroundColor) {
// currently we only support syncing background color and name
if (sceneData.appState) {
if (sceneData.appState.viewBackgroundColor) {
this.setState({
viewBackgroundColor: sceneData.appState.viewBackgroundColor,
});
}
if (sceneData.appState.name) {
this.setState({
name: sceneData.appState.name,
});
}
}
if (sceneData.elements) {
this.scene.replaceAllElements(sceneData.elements);