Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: TT-334 keep the sidebar item selected when the page is refreshed
  • Loading branch information
JosueOb committed Sep 9, 2021
commit f1c10359b415d2afedcc84f636392e50b9699c62
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ export class SidebarComponent implements OnInit, OnDestroy {

ngOnInit(): void {
this.toggleSideBar();
this.sidebarItems$ = this.getSidebarItems().subscribe();
this.highlightMenuOption(this.router.routerState.snapshot.url);
const currentRouting = this.router.routerState.snapshot.url;
this.sidebarItems$ = this.getSidebarItems().subscribe(() => this.highlightMenuOption(currentRouting));
this.navStart.subscribe((evt) => {
this.highlightMenuOption(evt.url);
});
}

ngOnDestroy(): void {
this.sidebarItems$.unsubscribe();
}
Expand Down