feat: add file logging toggle and logout confirmation

File logging defaulted to always-on meant the log grew silently on every
run with no way to turn it off. Changing the default to error-only and
exposing the toggle in Settings lets users opt in only when debugging.

The logout button previously triggered immediately without warning, making
accidental logouts unrecoverable without re-running the device code flow.
A confirmation step (Ja/Nein, gamepad-navigable) prevents that.
This commit is contained in:
Andre
2026-05-15 10:15:30 +02:00
parent a5eaafbed3
commit c7bc1a23c0
9 changed files with 134 additions and 17 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ import { getHlsCacheEnabled } from './prefs/hlsCachePref'
import log from 'electron-log/main'
log.initialize()
log.transports.file.level = 'info'
log.transports.file.level = 'error'
log.transports.console.level = 'debug'
const isDev = !app.isPackaged
+1
View File
@@ -30,6 +30,7 @@ export const IPC = {
appGetCacheSize: 'app:get-cache-size',
appClearCache: 'app:clear-cache',
appSetHlsCacheEnabled: 'app:set-hls-cache-enabled',
appSetFileLoggingEnabled: 'app:set-file-logging-enabled',
/** main → renderer */
gamepadInput: 'gamepad-input'
+3
View File
@@ -37,6 +37,9 @@ export function registerIpcHandlers(
safeHandle(IPC.appSetHlsCacheEnabled, (enabled: boolean) => {
setHlsCacheEnabled(Boolean(enabled))
})
safeHandle(IPC.appSetFileLoggingEnabled, (enabled: boolean) => {
log.transports.file.level = Boolean(enabled) ? 'info' : 'error'
})
safeHandle(IPC.authStatus, () => auth.getStatus())
safeHandle(IPC.authConfigured, () => auth.isConfigured())