mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-19 07:53:02 +00:00
Rework redirection using allOptions
This commit is contained in:
@@ -148,7 +148,17 @@ export class ComcolPageBrowseByComponent implements OnDestroy, OnInit {
|
||||
}));
|
||||
|
||||
if (this.router.url?.split('?')[0].endsWith(`/${this.id}`)) {
|
||||
void this.router.navigate([this.router.url, this.appConfig[this.contentType].defaultBrowseTab]);
|
||||
this.allOptions$.pipe(
|
||||
take(1),
|
||||
).subscribe((allOptions: ComColPageNavOption[]) => {
|
||||
for (const option of allOptions) {
|
||||
if (option.id === this.appConfig[this.contentType].defaultBrowseTab) {
|
||||
this.currentOption$.next(option[0]);
|
||||
void this.router.navigate([option.routerLink], { queryParams: option.params });
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user