mirror of
https://github.com/Andre-Bzk/twitch4steamdeck.git
synced 2026-11-15 15:43:08 +01:00
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:
+1
-1
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user