diff options
author | Hailey <me@haileyok.com> | 2024-07-11 18:37:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-11 18:37:43 -0700 |
commit | 83e8522e0a89be28b1733f4c50dbd4379d98d03b (patch) | |
tree | c51a1054ffa8f1b226412a77fa7d69f5c891f7ae /src/components/hooks | |
parent | 2397104ad6169ced02b1acd9fbbbe426f4cc4da0 (diff) | |
download | voidsky-83e8522e0a89be28b1733f4c50dbd4379d98d03b.tar.zst |
Create shared preferences API (#4654)
Diffstat (limited to 'src/components/hooks')
-rw-r--r-- | src/components/hooks/useStarterPackEntry.native.ts | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/components/hooks/useStarterPackEntry.native.ts b/src/components/hooks/useStarterPackEntry.native.ts index b6e4ab05b..212ecae71 100644 --- a/src/components/hooks/useStarterPackEntry.native.ts +++ b/src/components/hooks/useStarterPackEntry.native.ts @@ -7,7 +7,7 @@ import { import {isAndroid} from 'platform/detection' import {useHasCheckedForStarterPack} from 'state/preferences/used-starter-packs' import {useSetActiveStarterPack} from 'state/shell/starter-pack' -import {DevicePrefs, Referrer} from '../../../modules/expo-bluesky-swiss-army' +import {Referrer, SharedPrefs} from '../../../modules/expo-bluesky-swiss-army' export function useStarterPackEntry() { const [ready, setReady] = React.useState(false) @@ -39,14 +39,10 @@ export function useStarterPackEntry() { uri = createStarterPackLinkFromAndroidReferrer(res.installReferrer) } } else { - const res = await DevicePrefs.getStringValueAsync( - 'starterPackUri', - true, - ) - - if (res) { - uri = httpStarterPackUriToAtUri(res) - DevicePrefs.setStringValueAsync('starterPackUri', null, true) + const starterPackUri = SharedPrefs.getString('starterPackUri') + if (starterPackUri) { + uri = httpStarterPackUriToAtUri(starterPackUri) + SharedPrefs.setValue('starterPackUri', null) } } |