]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: fix multi-cluster route reload logic
authorAashish Sharma <Aashish.Sharma1@ibm.com>
Thu, 27 Nov 2025 09:22:47 +0000 (14:52 +0530)
committerAashish Sharma <Aashish.Sharma1@ibm.com>
Thu, 27 Nov 2025 09:26:18 +0000 (14:56 +0530)
Issue: Route was being force-reloaded using a two-step navigation hack causing unnecessary redirects and side effects.
Fix: Replaced the hack with Angular’s native same-URL reload using onSameUrlNavigation: 'reload' for a clean, stable route refresh.

Fixes: https://tracker.ceph.com/issues/74008
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/shared/api/multi-cluster.service.ts

index e17c1a741aa84ab99d07b98e03d72d520be1eac0..0864ff5a9c107cf731091bbee392341cf09194b3 100644 (file)
@@ -186,14 +186,9 @@ export class MultiClusterService {
     this.refresh();
     this.refreshTokenStatus();
     this.summaryService.refresh();
-    if (currentRoute.includes('dashboard')) {
-      this.router.navigateByUrl('/pool', { skipLocationChange: true }).then(() => {
-        this.router.navigate([currentRoute]);
-      });
-    } else {
-      this.router.navigateByUrl('/', { skipLocationChange: true }).then(() => {
-        this.router.navigate([currentRoute]);
-      });
-    }
+    this.router.navigate([currentRoute], {
+      onSameUrlNavigation: 'reload',
+      skipLocationChange: false
+    });
   }
 }