Fix: App Pin & Downloads (Filesystem Changes)

This commit is contained in:
Youwes09
2026-06-05 17:42:32 -05:00
parent 8aa92e6b54
commit 5dfbc80bbe
16 changed files with 577 additions and 490 deletions
+6 -2
View File
@@ -2,12 +2,16 @@ import type { Settings } from '$lib/types/settings'
import { DEFAULT_SETTINGS } from '$lib/types/settings'
import { saveSettings } from '$lib/core/persistence/persist'
export const settingsState = $state({ settings: { ...DEFAULT_SETTINGS } as Settings })
export const settingsState = $state({
settings: { ...DEFAULT_SETTINGS } as Settings,
loaded: false,
})
export async function loadSettingsIntoState(raw: unknown) {
if (raw && typeof raw === 'object') {
Object.assign(settingsState.settings, raw)
}
settingsState.loaded = true
if (typeof document !== 'undefined') {
document.documentElement.style.zoom = String(settingsState.settings.uiZoom ?? 1.0)
}
@@ -16,7 +20,6 @@ export async function loadSettingsIntoState(raw: unknown) {
export function updateSettings(patch: Partial<Settings>) {
Object.assign(settingsState.settings, patch)
void saveSettings({ storeVersion: 2, settings: settingsState.settings })
if (typeof document !== 'undefined' && patch.uiZoom !== undefined) {
document.documentElement.style.zoom = String(patch.uiZoom)
}
@@ -24,5 +27,6 @@ export function updateSettings(patch: Partial<Settings>) {
export function resetSettings() {
settingsState.settings = { ...DEFAULT_SETTINGS }
settingsState.loaded = true
void saveSettings({ storeVersion: 2, settings: settingsState.settings })
}