mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-10 16:46:06 -08:00
fix(hachidori): preserve setup completion while host connects
- Reopen setup only when a reachable host has no dictionaries
This commit is contained in:
2 files changed
+13
-5
No files matched your search
@@ -448,7 +448,7 @@ export function createFirstRunSetupService(deps: {
|
||||
getSetupStateDictionaryBackend(stored) === getDictionaryBackend()
|
||||
? stored
|
||||
: writeState(projectState(stored));
|
||||
const { configReady, dictionaryCount, externalYomitanConfigured } =
|
||||
const { configReady, dictionaryCount, externalYomitanConfigured, hachidoriHost } =
|
||||
await resolveYomitanSetupStatus({
|
||||
configFilePaths,
|
||||
getYomitanDictionaryCount: deps.getYomitanDictionaryCount,
|
||||
@@ -461,7 +461,11 @@ export function createFirstRunSetupService(deps: {
|
||||
dictionaryCount,
|
||||
externalYomitanConfigured,
|
||||
});
|
||||
if (isSetupCompleted(state) && canFinish) {
|
||||
// A linked host is usually still connecting at startup, so an unreachable host
|
||||
// says nothing about its dictionaries; only a reachable empty host reopens setup.
|
||||
const hostUnreachable =
|
||||
hachidoriHost?.kind === 'disconnected' || hachidoriHost?.kind === 'unavailable';
|
||||
if (isSetupCompleted(state) && (canFinish || (configReady && hostUnreachable))) {
|
||||
completed = true;
|
||||
return refreshWithState(state);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user