diff --git a/app/(auth)/(tabs)/(home)/index.tsx b/app/(auth)/(tabs)/(home)/index.tsx index 0b018087..5992f4a4 100644 --- a/app/(auth)/(tabs)/(home)/index.tsx +++ b/app/(auth)/(tabs)/(home)/index.tsx @@ -205,7 +205,7 @@ export default function index() { ); let sections: Section[] = []; - if (settings?.home === null || settings?.home?.sections === null) { + if (!settings?.home || !settings?.home?.sections) { sections = useMemo(() => { if (!api || !user?.Id) return []; diff --git a/utils/atoms/settings.ts b/utils/atoms/settings.ts index a4d1a135..9583bf68 100644 --- a/utils/atoms/settings.ts +++ b/utils/atoms/settings.ts @@ -189,7 +189,14 @@ const loadSettings = (): Settings => { } }; +const EXCLUDE_FROM_SAVE = ["home"]; + const saveSettings = (settings: Settings) => { + Object.keys(settings).forEach((key) => { + if (EXCLUDE_FROM_SAVE.includes(key)) { + delete settings[key as keyof Settings]; + } + }); const jsonValue = JSON.stringify(settings); storage.set("settings", jsonValue); }; @@ -277,6 +284,7 @@ export const useSettings = () => { if (Object.keys(unlockedPluginDefaults).length > 0) { updateSettings(unlockedPluginDefaults); } + return { ..._settings, ...overrideSettings,