diff options
Diffstat (limited to 'src/state/persisted/store.ts')
-rw-r--r-- | src/state/persisted/store.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/state/persisted/store.ts b/src/state/persisted/store.ts index 2b03bec20..04858fe5b 100644 --- a/src/state/persisted/store.ts +++ b/src/state/persisted/store.ts @@ -1,6 +1,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage' import {Schema, schema} from '#/state/persisted/schema' +import {logger} from '#/logger' const BSKY_STORAGE = 'BSKY_STORAGE' @@ -16,3 +17,11 @@ export async function read(): Promise<Schema | undefined> { return objData } } + +export async function clear() { + try { + await AsyncStorage.removeItem(BSKY_STORAGE) + } catch (e: any) { + logger.error(`persisted store: failed to clear`, {error: e.toString()}) + } +} |