0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Added graceful handling of suggested profile errors in admin-x-activitypub (#21366)

no refs

Added graceful handling of suggested profile errors in
admin-x-activitypub
This commit is contained in:
Michael Barrett 2024-10-22 15:49:21 +01:00 committed by GitHub
parent f214213859
commit 94584489b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -323,9 +323,14 @@ export function useSuggestedProfiles(handle: string, handles: string[]) {
async queryFn() {
const siteUrl = await getSiteUrl();
const api = createActivityPubAPI(handle, siteUrl);
return Promise.all(
return Promise.allSettled(
handles.map(h => api.getProfile(h))
);
).then((results) => {
return results
.filter((result): result is PromiseFulfilledResult<Profile> => result.status === 'fulfilled')
.map(result => result.value);
});
}
});