diff options
Diffstat (limited to 'packages/mobile/lib/settings.ts')
| -rw-r--r-- | packages/mobile/lib/settings.ts | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/packages/mobile/lib/settings.ts b/packages/mobile/lib/settings.ts deleted file mode 100644 index 21f40528..00000000 --- a/packages/mobile/lib/settings.ts +++ /dev/null @@ -1,29 +0,0 @@ -import * as SecureStore from "expo-secure-store"; - -import { useStorageState } from "./storage-state"; - -const SETTING_NAME = "settings"; - -export type Settings = { - apiKey?: string; - address: string; -}; - -export default function useAppSettings() { - let [[isLoading, settings], setSettings] = - useStorageState<Settings>(SETTING_NAME); - - settings ||= { - address: "https://demo.hoarder.app", - }; - - return { settings, setSettings, isLoading }; -} - -export async function getAppSettings() { - const val = await SecureStore.getItemAsync(SETTING_NAME); - if (!val) { - return null; - } - return JSON.parse(val) as Settings; -} |
