Commit e85a3f1d by Torkel Ödegaard

fix redirect issue, caused by timing of events between angular location change…

fix redirect issue, caused by timing of events between angular location change and redux state changes
parent 4822c025
...@@ -77,6 +77,10 @@ export class DashboardSrv { ...@@ -77,6 +77,10 @@ export class DashboardSrv {
postSave(clone, data) { postSave(clone, data) {
this.dash.version = data.version; this.dash.version = data.version;
// important that these happens before location redirect below
this.$rootScope.appEvent('dashboard-saved', this.dash);
this.$rootScope.appEvent('alert-success', ['Dashboard saved']);
const newUrl = locationUtil.stripBaseFromUrl(data.url); const newUrl = locationUtil.stripBaseFromUrl(data.url);
const currentPath = this.$location.path(); const currentPath = this.$location.path();
...@@ -84,9 +88,6 @@ export class DashboardSrv { ...@@ -84,9 +88,6 @@ export class DashboardSrv {
this.$location.url(newUrl).replace(); this.$location.url(newUrl).replace();
} }
this.$rootScope.appEvent('dashboard-saved', this.dash);
this.$rootScope.appEvent('alert-success', ['Dashboard saved']);
return this.dash; return this.dash;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment