120150: Fixed authorization tab not loading in dev mode

This commit is contained in:
Alexandre Vryghem
2024-11-12 11:33:45 +01:00
parent f6d8446c75
commit c062d95354

View File

@@ -40,7 +40,7 @@ export const itemPageResolver: ResolveFn<RemoteData<Item>> = (
store: Store<AppState> = inject(Store<AppState>), store: Store<AppState> = inject(Store<AppState>),
authService: AuthService = inject(AuthService), authService: AuthService = inject(AuthService),
): Observable<RemoteData<Item>> => { ): Observable<RemoteData<Item>> => {
return itemService.findById( const itemRD$ = itemService.findById(
route.params.id, route.params.id,
true, true,
false, false,
@@ -48,8 +48,14 @@ export const itemPageResolver: ResolveFn<RemoteData<Item>> = (
).pipe( ).pipe(
getFirstCompletedRemoteData(), getFirstCompletedRemoteData(),
redirectOn4xx(router, authService), redirectOn4xx(router, authService),
);
itemRD$.subscribe((itemRD: RemoteData<Item>) => {
store.dispatch(new ResolvedAction(state.url, itemRD.payload));
});
return itemRD$.pipe(
map((rd: RemoteData<Item>) => { map((rd: RemoteData<Item>) => {
store.dispatch(new ResolvedAction(state.url, rd.payload));
if (rd.hasSucceeded && hasValue(rd.payload)) { if (rd.hasSucceeded && hasValue(rd.payload)) {
const thisRoute = state.url; const thisRoute = state.url;