mirror of
https://github.com/filecoin-project/slate.git
synced 2024-09-17 17:27:52 +03:00
fix(viewer): use promise.allSettled instead of promise.all in the getById method
This commit is contained in:
parent
b3c23bdb45
commit
e04c528c3b
@ -148,14 +148,16 @@ export const getById = async ({ id }) => {
|
||||
|
||||
// user.library = await Data.getFilesByUserId({ id, sanitize: true });
|
||||
|
||||
const [slates, keys, subscriptions, following, followers, { bucketRoot }] = await Promise.all([
|
||||
const [slates, keys, subscriptions, following, followers, { bucketRoot }] = (
|
||||
await Promise.allSettled([
|
||||
Data.getSlatesByUserId({ ownerId: id, sanitize: true, includeFiles: true }),
|
||||
Data.getAPIKeysByUserId({ userId: id }),
|
||||
Data.getSubscriptionsByUserId({ ownerId: id }),
|
||||
Data.getFollowingByUserId({ ownerId: id }),
|
||||
Data.getFollowersByUserId({ userId: id }),
|
||||
Utilities.getBucketAPIFromUserToken({ user }),
|
||||
]);
|
||||
])
|
||||
).map((item) => item.value);
|
||||
|
||||
const libraryCids =
|
||||
user?.library?.reduce((acc, file) => ({ ...acc, [file.cid]: file }), {}) || {};
|
||||
|
Loading…
Reference in New Issue
Block a user