Skip to content

Commit 017bb46

Browse files
committed
Heatmap: Improved angular navigation
1 parent 4eb0495 commit 017bb46

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/app/pages/circular-heatmap/circular-heatmap.component.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,11 @@ export class CircularHeatmapComponent implements OnInit {
593593

594594
// Update URL with activity UUID as fragment
595595
if (activity.uuid) {
596-
const url = this.router.createUrlTree([], { fragment: activity.uuid }).toString();
597-
this.location.go(url);
596+
this.router.navigate([], {
597+
relativeTo: this.route,
598+
fragment: activity.uuid,
599+
queryParamsHandling: 'preserve'
600+
});
598601
}
599602
/* eslint-enable */
600603
}
@@ -619,10 +622,9 @@ export class CircularHeatmapComponent implements OnInit {
619622
}
620623

621624
closeOverlay() {
622-
this.showOverlay = false;
623625
// Clear the URL fragment when closing overlay
624-
const url = this.router.createUrlTree([]).toString();
625-
this.location.go(url);
626+
this.router.navigate([], { relativeTo: this.route, fragment: undefined, queryParamsHandling: 'preserve' });
627+
this.showOverlay = false;
626628
}
627629

628630
toggleFilters() {

0 commit comments

Comments
 (0)