feat(desktop): enhance error handling and logging for session synchronization and window mode transitions
Desktop Client Build / Resolve Build Metadata (push) Successful in 24s
Desktop Client Build / Build Desktop Client (push) Successful in 22m50s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 27s

This commit is contained in:
2026-06-04 16:39:30 +08:00
parent ae455ea21c
commit b40434018a
6 changed files with 85 additions and 22 deletions
+13 -2
View File
@@ -30,7 +30,14 @@ function getModeBridge(): WindowModeBridge | undefined {
}
function syncWindowMode(authenticated: boolean): void {
void getModeBridge()?.setWindowMode?.(authenticated ? 'main' : 'login', { source: 'auth-state' })
void getModeBridge()
?.setWindowMode?.(authenticated ? 'main' : 'login', { source: 'auth-state' })
.catch((err) => {
console.warn('[desktop-app] window mode sync failed', {
authenticated,
message: err instanceof Error ? err.message : String(err),
})
})
}
const rendererWindowMode = resolveRendererWindowMode()
@@ -62,7 +69,11 @@ if (rendererWindowMode === 'main') {
onMounted(() => {
if (rendererWindowMode !== 'login') {
void syncRuntimeSession()
void syncRuntimeSession().catch((err) => {
console.warn('[desktop-app] runtime session sync failed', {
message: err instanceof Error ? err.message : String(err),
})
})
}
if (usesAutomaticWindowMode) {
syncWindowMode(isAuthenticated.value)