remove mmkv storage in debug btn
This commit is contained in:
@@ -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()})
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user