diff --git a/src/libs/OIerDb.ts b/src/libs/OIerDb.ts index 4ad97fe..5b46b9a 100644 --- a/src/libs/OIerDb.ts +++ b/src/libs/OIerDb.ts @@ -393,8 +393,14 @@ export const initDb = async (setProgressPercent?: (p: number) => void) => { setProgressPercent(8); if (checkSha512(staticSha512, resultSha512)) { - const staticData = await getDataFromIndexedDb('static'); - const oiers = await getDataFromIndexedDb('oiers'); + setProgressPercent(91); + + const [staticData, oiers] = await Promise.all([ + await getDataFromIndexedDb('static'), + await getDataFromIndexedDb('oiers'), + ]); + + setProgressPercent(96); if (staticData && oiers) { return (__DATA__ = processData({ static: staticData, oiers })); @@ -421,6 +427,8 @@ export const initDb = async (setProgressPercent?: (p: number) => void) => { 'result.txt' ).then(textToRaw); + setProgressPercent(91); + await saveDataToIndexedDb('static', staticData); setProgressPercent(93);