mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-11 05:15:08 +01:00
Use Promise.all for simultaneous calls
This commit is contained in:
parent
703dfc7434
commit
67f3047463
@ -149,8 +149,10 @@ export function useAuth() {
|
|||||||
bookmarkMediaToInput(tmdbId, item),
|
bookmarkMediaToInput(tmdbId, item),
|
||||||
);
|
);
|
||||||
|
|
||||||
await importProgress(backendUrl, account, progressInputs);
|
await Promise.all([
|
||||||
await importBookmarks(backendUrl, account, bookmarkInputs);
|
importProgress(backendUrl, account, progressInputs),
|
||||||
|
importBookmarks(backendUrl, account, bookmarkInputs),
|
||||||
|
]);
|
||||||
},
|
},
|
||||||
[backendUrl],
|
[backendUrl],
|
||||||
);
|
);
|
||||||
@ -174,9 +176,11 @@ export function useAuth() {
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bookmarks = await getBookmarks(backendUrl, account);
|
const [bookmarks, progress, settings] = await Promise.all([
|
||||||
const progress = await getProgress(backendUrl, account);
|
getBookmarks(backendUrl, account),
|
||||||
const settings = await getSettings(backendUrl, account);
|
getProgress(backendUrl, account),
|
||||||
|
getSettings(backendUrl, account),
|
||||||
|
]);
|
||||||
|
|
||||||
syncData(user.user, user.session, progress, bookmarks, settings);
|
syncData(user.user, user.session, progress, bookmarks, settings);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user