remove mmkv storage in debug btn

This commit is contained in:
Samuel Newman
2025-08-05 20:20:05 +03:00
parent 0e53f4339b
commit c1b6ae8b6e
3 changed files with 12 additions and 3 deletions
+4 -2
View File
@@ -3,11 +3,12 @@ import AsyncStorage from '@react-native-async-storage/async-storage'
import {logger} from '#/logger'
import {
defaults,
Schema,
type Schema,
tryParse,
tryStringify,
} from '#/state/persisted/schema'
import {PersistedApi} from './types'
import {device} from '#/storage'
import {type PersistedApi} from './types'
import {normalizeData} from './util'
export type {PersistedAccount, Schema} from '#/state/persisted/schema'
@@ -53,6 +54,7 @@ onUpdate satisfies PersistedApi['onUpdate']
export async function clearStorage() {
try {
await AsyncStorage.removeItem(BSKY_STORAGE)
device.removeAll()
} catch (e: any) {
logger.error(`persisted store: failed to clear`, {message: e.toString()})
}
+7
View File
@@ -66,6 +66,13 @@ export class Storage<Scopes extends unknown[], Schema> {
keys.forEach(key => this.remove([...scopes, key]))
}
/**
* For debugging purposes
*/
removeAll() {
this.store.clearAll()
}
/**
* Fires a callback when the storage associated with a given key changes
*
@@ -40,10 +40,10 @@ import {Onboarding} from '#/screens/Onboarding'
import {SignupQueued} from '#/screens/SignupQueued'
import {Takendown} from '#/screens/Takendown'
import {atoms as a, useLayoutBreakpoints} from '#/alf'
import {BlockingAnnouncements} from '#/components/dialogs/BlockingAnnouncements'
import {BottomBarWeb} from './bottom-bar/BottomBarWeb'
import {DesktopLeftNav} from './desktop/LeftNav'
import {DesktopRightNav} from './desktop/RightNav'
import {BlockingAnnouncements} from '#/components/dialogs/BlockingAnnouncements'
type NativeStackNavigationOptionsWithAuth = NativeStackNavigationOptions & {
requireAuth?: boolean