diff --git a/src/components/App.tsx b/src/components/App.tsx index 1889a1f7b..7b8c49217 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1866,10 +1866,8 @@ class App extends React.Component { componentDidUpdate(prevProps: AppProps, prevState: AppState) { this.updateEmbeddables(); - if ( - !this.state.showWelcomeScreen && - !this.scene.getElementsIncludingDeleted().length - ) { + const elementsIncludingDeleted = this.scene.getElementsIncludingDeleted(); + if (!this.state.showWelcomeScreen && !elementsIncludingDeleted.length) { this.setState({ showWelcomeScreen: true }); } @@ -2058,7 +2056,7 @@ class App extends React.Component { isViewportOutsideOfConstrainedArea && this.state.cursorButton !== "down" && prevState.zoom.value === this.state.zoom.value && - this.scene.getElementsIncludingDeleted().length > 0, // Do not animate when app is initialized but scene is empty - this would cause flickering + elementsIncludingDeleted.length > 0, // Do not animate when app is initialized but scene is empty - this would cause flickering }); }