mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
chore: move this.scene.getElementsIncludingDeleted() result into const
This commit is contained in:
parent
04e23e1d29
commit
4469c02191
1 changed files with 3 additions and 5 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue