mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-28 05:01:56 +01:00
Merge pull request #816 from movie-web/promise-dot-all
Use Promise.all for simultaneous calls
This commit is contained in:
commit
0295dc41ee
@ -149,8 +149,10 @@ export function useAuth() {
|
||||
bookmarkMediaToInput(tmdbId, item),
|
||||
);
|
||||
|
||||
await importProgress(backendUrl, account, progressInputs);
|
||||
await importBookmarks(backendUrl, account, bookmarkInputs);
|
||||
await Promise.all([
|
||||
importProgress(backendUrl, account, progressInputs),
|
||||
importBookmarks(backendUrl, account, bookmarkInputs),
|
||||
]);
|
||||
},
|
||||
[backendUrl],
|
||||
);
|
||||
@ -174,9 +176,11 @@ export function useAuth() {
|
||||
throw err;
|
||||
}
|
||||
|
||||
const bookmarks = await getBookmarks(backendUrl, account);
|
||||
const progress = await getProgress(backendUrl, account);
|
||||
const settings = await getSettings(backendUrl, account);
|
||||
const [bookmarks, progress, settings] = await Promise.all([
|
||||
getBookmarks(backendUrl, account),
|
||||
getProgress(backendUrl, account),
|
||||
getSettings(backendUrl, account),
|
||||
]);
|
||||
|
||||
syncData(user.user, user.session, progress, bookmarks, settings);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user