fix: harden startup flow and auth re-entry

This commit is contained in:
Misaka
2026-03-21 11:02:17 +08:00
parent ed65312fff
commit 9a1f5a483e
10 changed files with 86 additions and 38 deletions

View File

@@ -44,7 +44,7 @@ function appendPortableLaunchLog(
}
function getCurrentAppVersion(): string {
return typeof app.getVersion === 'function' ? app.getVersion() : '0.0.0'
return typeof app?.getVersion === 'function' ? app.getVersion() : '0.0.0'
}
function getCurrentChannel(): ReleaseChannel {
@@ -79,7 +79,7 @@ function getSupportState(config: UpdateConfig | null): {
return { supported: false, reason: '当前仅支持 Windows 自动更新' }
}
if (app.isPackaged) {
if (app?.isPackaged) {
return { supported: true }
}