File tree Expand file tree Collapse file tree
src/plugins/dashboard/public/application Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -620,6 +620,12 @@ export class DashboardAppController {
620620 ReactDOM . render ( < navigation . ui . TopNavMenu { ...getNavBarProps ( ) } /> , dashboardNavBar ) ;
621621 } ;
622622
623+ const unmountNavBar = ( ) => {
624+ if ( dashboardNavBar ) {
625+ ReactDOM . unmountComponentAtNode ( dashboardNavBar ) ;
626+ }
627+ } ;
628+
623629 $scope . timefilterSubscriptions$ = new Subscription ( ) ;
624630
625631 $scope . timefilterSubscriptions$ . add (
@@ -968,6 +974,9 @@ export class DashboardAppController {
968974 } ) ;
969975
970976 $scope . $on ( '$destroy' , ( ) => {
977+ // we have to unmount nav bar manually to make sure all internal subscriptions are unsubscribed
978+ unmountNavBar ( ) ;
979+
971980 updateSubscription . unsubscribe ( ) ;
972981 stopSyncingQueryServiceStateWithUrl ( ) ;
973982 stopSyncingAppFilters ( ) ;
@@ -981,6 +990,9 @@ export class DashboardAppController {
981990 if ( outputSubscription ) {
982991 outputSubscription . unsubscribe ( ) ;
983992 }
993+ if ( dashboardContainer ) {
994+ dashboardContainer . destroy ( ) ;
995+ }
984996 } ) ;
985997 }
986998}
You can’t perform that action at this time.
0 commit comments