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 });
|
// 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 }] = (
|
||||||
Data.getSlatesByUserId({ ownerId: id, sanitize: true, includeFiles: true }),
|
await Promise.allSettled([
|
||||||
Data.getAPIKeysByUserId({ userId: id }),
|
Data.getSlatesByUserId({ ownerId: id, sanitize: true, includeFiles: true }),
|
||||||
Data.getSubscriptionsByUserId({ ownerId: id }),
|
Data.getAPIKeysByUserId({ userId: id }),
|
||||||
Data.getFollowingByUserId({ ownerId: id }),
|
Data.getSubscriptionsByUserId({ ownerId: id }),
|
||||||
Data.getFollowersByUserId({ userId: id }),
|
Data.getFollowingByUserId({ ownerId: id }),
|
||||||
Utilities.getBucketAPIFromUserToken({ user }),
|
Data.getFollowersByUserId({ userId: id }),
|
||||||
]);
|
Utilities.getBucketAPIFromUserToken({ user }),
|
||||||
|
])
|
||||||
|
).map((item) => item.value);
|
||||||
|
|
||||||
const libraryCids =
|
const libraryCids =
|
||||||
user?.library?.reduce((acc, file) => ({ ...acc, [file.cid]: file }), {}) || {};
|
user?.library?.reduce((acc, file) => ({ ...acc, [file.cid]: file }), {}) || {};
|
||||||
|
Loading…
Reference in New Issue
Block a user