From 2e9433c495c327afa0215ceea3a597a0d0e83732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 16 Feb 2018 16:29:14 +0100 Subject: [PATCH] fix: fixed redirect after save, fixes #10946 --- public/app/features/dashboard/dashboard_srv.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/app/features/dashboard/dashboard_srv.ts b/public/app/features/dashboard/dashboard_srv.ts index a1ff99007e3..b41d7b0583e 100644 --- a/public/app/features/dashboard/dashboard_srv.ts +++ b/public/app/features/dashboard/dashboard_srv.ts @@ -77,8 +77,11 @@ export class DashboardSrv { postSave(clone, data) { this.dash.version = data.version; - if (data.url !== this.$location.path()) { - this.$location.url(locationUtil.stripBaseFromUrl(data.url)).replace(); + const newUrl = locationUtil.stripBaseFromUrl(data.url); + const currentPath = this.$location.path(); + + if (newUrl !== currentPath) { + this.$location.url(newUrl).replace(); } this.$rootScope.appEvent('dashboard-saved', this.dash);