File tree Expand file tree Collapse file tree
packages/react-devtools-extensions/src/main Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -412,13 +412,16 @@ chrome.devtools.network.onNavigated.addListener(syncSavedPreferences);
412412// into subscribing to the same events from Bridge and window multiple times
413413// In this case, we will handle `operations` event twice or more and user will see
414414// `Cannot add node "1" because a node with that id is already in the Store.`
415- const debouncedOnNavigatedListener = debounce ( ( ) => {
415+ const debouncedMountReactDevToolsCallback = debounce ( mountReactDevToolsWhenReactHasLoaded , 500 ) ;
416+
417+ // Clean up everything, but start mounting React DevTools panels if user stays at this page
418+ function onNavigatedToOtherPage ( ) {
416419 performInTabNavigationCleanup ( ) ;
417- mountReactDevToolsWhenReactHasLoaded ( ) ;
418- } , 500 ) ;
420+ debouncedMountReactDevToolsCallback ( ) ;
421+ }
419422
420423// Cleanup previous page state and remount everything
421- chrome . devtools . network . onNavigated . addListener ( debouncedOnNavigatedListener ) ;
424+ chrome . devtools . network . onNavigated . addListener ( onNavigatedToOtherPage ) ;
422425
423426// Should be emitted when browser DevTools are closed
424427if ( __IS_FIREFOX__ ) {
You can’t perform that action at this time.
0 commit comments