fix(SearchLocal): improve database progress tracking and UI phase advancement
This commit is contained in:
parent
eb0357253c
commit
b0c37694ba
|
|
@ -233,8 +233,13 @@ export default function SearchLocal({ config, setConfig, onClose, onOpenFolder }
|
|||
setEngineProgress({ received: 0, total: null });
|
||||
setDatabaseProgress({ received: 0, total: null });
|
||||
await openLocateDb(p => flushSync(() => {
|
||||
if (p.kind === 'engine') setEngineProgress({ received: p.received, total: p.total });
|
||||
else setDatabaseProgress({ received: p.received, total: p.total });
|
||||
if (p.kind === 'engine') {
|
||||
setEngineProgress({ received: p.received, total: p.total });
|
||||
} else {
|
||||
// First database chunk arrives → engine phase is done, advance UI.
|
||||
setDatabaseProgress({ received: p.received, total: p.total });
|
||||
setDbPhase(phase => phase === 'engine' ? 'downloading' : phase);
|
||||
}
|
||||
}));
|
||||
setDbPhase('ready');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user