Skip to content

Commit 5d4006f

Browse files
committed
Rework redirection using allOptions
1 parent 262f758 commit 5d4006f

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,17 @@ export class ComcolPageBrowseByComponent implements OnDestroy, OnInit {
148148
}));
149149

150150
if (this.router.url?.split('?')[0].endsWith(`/${this.id}`)) {
151-
void this.router.navigate([this.router.url, this.appConfig[this.contentType].defaultBrowseTab]);
151+
this.allOptions$.pipe(
152+
take(1),
153+
).subscribe((allOptions: ComColPageNavOption[]) => {
154+
for (const option of allOptions) {
155+
if (option.id === this.appConfig[this.contentType].defaultBrowseTab) {
156+
this.currentOption$.next(option[0]);
157+
void this.router.navigate([option.routerLink], { queryParams: option.params });
158+
break;
159+
}
160+
}
161+
});
152162
}
153163
}
154164

0 commit comments

Comments
 (0)