Browse Source

dashboard_history: fix for scenario where reverted dashbord has different title and url must change not just route reload

Torkel Ödegaard 8 years ago
parent
commit
3ba8aeb9a7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      public/app/features/dashboard/history/history.ts

+ 2 - 2
public/app/features/dashboard/history/history.ts

@@ -28,7 +28,7 @@ export class HistoryListCtrl {
   /** @ngInject */
   /** @ngInject */
   constructor(private $scope,
   constructor(private $scope,
               private $rootScope,
               private $rootScope,
-              private $route,
+              private $location,
               private $window,
               private $window,
               private $timeout,
               private $timeout,
               private $q,
               private $q,
@@ -178,7 +178,7 @@ export class HistoryListCtrl {
   restoreConfirm(version: number) {
   restoreConfirm(version: number) {
     this.loading = true;
     this.loading = true;
     return this.historySrv.restoreDashboard(this.dashboard, version).then(response => {
     return this.historySrv.restoreDashboard(this.dashboard, version).then(response => {
-      this.$route.reload();
+      this.$location.path('dashboard/db/' + response.slug);
       this.$rootScope.appEvent('alert-success', ['Dashboard restored', 'Restored from version ' + version]);
       this.$rootScope.appEvent('alert-success', ['Dashboard restored', 'Restored from version ' + version]);
     }).catch(() => {
     }).catch(() => {
       this.mode = 'list';
       this.mode = 'list';