Skip to content

Commit

Permalink
Fix AuthorizationDataService.isAuthorized throwing a console error wh…
Browse files Browse the repository at this point in the history
…en the searchByObject request doesn't succeed
  • Loading branch information
alexandrevryghem committed Oct 21, 2023
1 parent 987a92f commit 51b13fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class AuthorizationDataService extends BaseDataService<Authorization> imp
return [];
}
}),
catchError(() => observableOf(false)),
catchError(() => observableOf([])),
oneAuthorizationMatchesFeature(featureId)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ export const oneAuthorizationMatchesFeature = (featureID: FeatureID) =>
source.pipe(
switchMap((authorizations: Authorization[]) => {
if (isNotEmpty(authorizations)) {
return observableCombineLatest(
return observableCombineLatest([
...authorizations
.filter((authorization: Authorization) => hasValue(authorization.feature))
.map((authorization: Authorization) => authorization.feature.pipe(
getFirstSucceededRemoteDataPayload()
))
);
]);
} else {
return observableOf([]);
}
Expand Down

0 comments on commit 51b13fb

Please sign in to comment.