aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/lib/settings.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/mobile/lib/settings.ts')
-rw-r--r--apps/mobile/lib/settings.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/mobile/lib/settings.ts b/apps/mobile/lib/settings.ts
index 745c778d..8da1d33d 100644
--- a/apps/mobile/lib/settings.ts
+++ b/apps/mobile/lib/settings.ts
@@ -1,3 +1,4 @@
+import { useEffect } from "react";
import * as SecureStore from "expo-secure-store";
import { z } from "zod";
import { create } from "zustand";
@@ -77,6 +78,12 @@ const useSettings = create<AppSettingsState>((set, get) => ({
export default function useAppSettings() {
const { settings, setSettings, load } = useSettings();
+ useEffect(() => {
+ if (settings.isLoading) {
+ load();
+ }
+ }, [load, settings.isLoading]);
+
return { ...settings, setSettings, load };
}