promise all sync

This commit is contained in:
fyears 2021-11-06 22:51:27 +08:00
parent 2012758383
commit b6df3f7ed5

View File

@ -290,6 +290,7 @@ export const doActualSync = async (
keyStates: Record<string, FileOrFolderMixedState>, keyStates: Record<string, FileOrFolderMixedState>,
password: string = "" password: string = ""
) => { ) => {
await Promise.all(
Object.entries(keyStates) Object.entries(keyStates)
.sort((k, v) => -(k as string).length) .sort((k, v) => -(k as string).length)
.map(async ([k, v]) => { .map(async ([k, v]) => {
@ -388,5 +389,6 @@ export const doActualSync = async (
} else { } else {
throw Error("this should never happen!"); throw Error("this should never happen!");
} }
}); })
);
}; };