diff --git a/src/ui/public/state_management/state.js b/src/ui/public/state_management/state.js index cf412c0627910..8f238b13a1715 100644 --- a/src/ui/public/state_management/state.js +++ b/src/ui/public/state_management/state.js @@ -27,10 +27,14 @@ export default function StateProvider(Private, $rootScope, $location) { // beginning of full route update, new app will be initialized before // $routeChangeSuccess or $routeChangeError $rootScope.$on('$routeChangeStart', function () { + if (!self._persistAcrossApps) { + self.destroy(); + } + }), + + $rootScope.$on('$routeChangeSuccess', function () { if (self._persistAcrossApps) { self.fetch(); - } else { - self.destroy(); } }) ]);