From c062d95354cea7118b9ab2babc2759409fe2ae10 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Tue, 12 Nov 2024 11:33:45 +0100 Subject: [PATCH] 120150: Fixed authorization tab not loading in dev mode --- src/app/item-page/item-page.resolver.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/item-page/item-page.resolver.ts b/src/app/item-page/item-page.resolver.ts index 22267f3ce6f..ef59bf00b8e 100644 --- a/src/app/item-page/item-page.resolver.ts +++ b/src/app/item-page/item-page.resolver.ts @@ -40,7 +40,7 @@ export const itemPageResolver: ResolveFn> = ( store: Store = inject(Store), authService: AuthService = inject(AuthService), ): Observable> => { - return itemService.findById( + const itemRD$ = itemService.findById( route.params.id, true, false, @@ -48,8 +48,14 @@ export const itemPageResolver: ResolveFn> = ( ).pipe( getFirstCompletedRemoteData(), redirectOn4xx(router, authService), + ); + + itemRD$.subscribe((itemRD: RemoteData) => { + store.dispatch(new ResolvedAction(state.url, itemRD.payload)); + }); + + return itemRD$.pipe( map((rd: RemoteData) => { - store.dispatch(new ResolvedAction(state.url, rd.payload)); if (rd.hasSucceeded && hasValue(rd.payload)) { const thisRoute = state.url;