chore: move this.scene.getElementsIncludingDeleted() result into const
This commit is contained in:
parent
04e23e1d29
commit
4469c02191
@ -1866,10 +1866,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
|
|
||||||
componentDidUpdate(prevProps: AppProps, prevState: AppState) {
|
componentDidUpdate(prevProps: AppProps, prevState: AppState) {
|
||||||
this.updateEmbeddables();
|
this.updateEmbeddables();
|
||||||
if (
|
const elementsIncludingDeleted = this.scene.getElementsIncludingDeleted();
|
||||||
!this.state.showWelcomeScreen &&
|
if (!this.state.showWelcomeScreen && !elementsIncludingDeleted.length) {
|
||||||
!this.scene.getElementsIncludingDeleted().length
|
|
||||||
) {
|
|
||||||
this.setState({ showWelcomeScreen: true });
|
this.setState({ showWelcomeScreen: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2058,7 +2056,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
isViewportOutsideOfConstrainedArea &&
|
isViewportOutsideOfConstrainedArea &&
|
||||||
this.state.cursorButton !== "down" &&
|
this.state.cursorButton !== "down" &&
|
||||||
prevState.zoom.value === this.state.zoom.value &&
|
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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user