Skip to main content

Function: normalizeAppSettings()

normalizeAppSettings(candidate: LegacySettingsSnapshot & Partial<AppSettings>): AppSettings

Defined in: src/stores/settings/state.ts:95

Normalizes persisted or partial settings objects into a complete AppSettings structure.

Parametersโ€‹

candidateโ€‹

LegacySettingsSnapshot & Partial<AppSettings> = {}

Partial settings snapshot, potentially containing legacy fields.

Returnsโ€‹

AppSettings

A fully normalized settings object.

Remarksโ€‹

Handles migration from legacy fields (notifications, soundAlerts) by mapping them to the new alert-specific toggles. Missing properties are filled with defaultSettings to guarantee a fully-populated settings object.