From 016b054288e4ce4776c25f2ea4a6dec40668262e Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Sun, 21 Mar 2021 02:05:04 +0530 Subject: [PATCH] fix: Don't trigger onChange on initial load --- src/components/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 46acaf635..51003fcc0 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1022,7 +1022,7 @@ class App extends React.Component { // potential issues, this fixes a case where the tab isn't focused during // init, which would trigger onChange with empty elements, which would then // override whatever is in localStorage currently. - if (!this.state.isLoading) { + if (!this.state.isLoading && !prevState.isLoading) { this.props.onChange?.( this.scene.getElementsIncludingDeleted(), this.state,