Skip to content

Commit 704ba0e

Browse files
authored
fix: TT-334 keep the sidebar item selected when the page is refreshed (#748)
1 parent 13fd98a commit 704ba0e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/app/modules/shared/components/sidebar/sidebar.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ export class SidebarComponent implements OnInit, OnDestroy {
2626

2727
ngOnInit(): void {
2828
this.toggleSideBar();
29-
this.sidebarItems$ = this.getSidebarItems().subscribe();
30-
this.highlightMenuOption(this.router.routerState.snapshot.url);
29+
const currentRouting = this.router.routerState.snapshot.url;
30+
this.sidebarItems$ = this.getSidebarItems().subscribe(() => this.highlightMenuOption(currentRouting));
3131
this.navStart.subscribe((evt) => {
3232
this.highlightMenuOption(evt.url);
3333
});
3434
}
35+
3536
ngOnDestroy(): void {
3637
this.sidebarItems$.unsubscribe();
3738
}

0 commit comments

Comments
 (0)