Commit 33690f9 1 parent ed6e5f9 commit 33690f9 Copy full SHA for 33690f9
File tree 1 file changed +3
-2
lines changed
superset-frontend/src/explore/components/ExploreViewContainer
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -252,6 +252,7 @@ function ExploreViewContainer(props) {
252
252
const theme = useTheme ( ) ;
253
253
254
254
const isBeforeUnloadActive = useRef ( false ) ;
255
+ const initialFormData = useRef ( props . form_data ) ;
255
256
256
257
const defaultSidebarsWidth = {
257
258
controls_width : 320 ,
@@ -384,7 +385,7 @@ function ExploreViewContainer(props) {
384
385
385
386
useEffect ( ( ) => {
386
387
const formDataChanged = ! isEmpty (
387
- getFormDataDiffs ( props . chart . sliceFormData , props . form_data ) ,
388
+ getFormDataDiffs ( initialFormData . current , props . form_data ) ,
388
389
) ;
389
390
if ( formDataChanged && ! isBeforeUnloadActive . current ) {
390
391
window . addEventListener ( 'beforeunload' , handleUnloadEvent ) ;
@@ -394,7 +395,7 @@ function ExploreViewContainer(props) {
394
395
window . removeEventListener ( 'beforeunload' , handleUnloadEvent ) ;
395
396
isBeforeUnloadActive . current = false ;
396
397
}
397
- } , [ props . chart . sliceFormData , props . form_data ] ) ;
398
+ } , [ props . form_data ] ) ;
398
399
399
400
// cleanup beforeunload event listener
400
401
// we use separate useEffect to call it only on component unmount instead of on every form data change
You can’t perform that action at this time.
0 commit comments