Skip to content

Commit

Permalink
chore: better loading progress report
Browse files Browse the repository at this point in the history
just make users happy :)
  • Loading branch information
renbaoshuo committed Jan 12, 2025
1 parent ebc517a commit c68ee2c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/libs/OIerDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }));
Expand All @@ -421,6 +427,8 @@ export const initDb = async (setProgressPercent?: (p: number) => void) => {
'result.txt'
).then(textToRaw);

setProgressPercent(91);

await saveDataToIndexedDb('static', staticData);

setProgressPercent(93);
Expand Down

0 comments on commit c68ee2c

Please sign in to comment.