diff options
Diffstat (limited to 'src/view/screens/Settings.tsx')
-rw-r--r-- | src/view/screens/Settings.tsx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/view/screens/Settings.tsx b/src/view/screens/Settings.tsx index 1f7623440..cc4348fff 100644 --- a/src/view/screens/Settings.tsx +++ b/src/view/screens/Settings.tsx @@ -64,6 +64,8 @@ import { import {useProfileQuery} from '#/state/queries/profile' import {useClearPreferencesMutation} from '#/state/queries/preferences' import {useInviteCodesQuery} from '#/state/queries/invites' +import {clear as clearStorage} from '#/state/persisted/store' +import {clearLegacyStorage} from '#/state/persisted/legacy' // TEMPORARY (APP-700) // remove after backend testing finishes @@ -266,6 +268,15 @@ export const SettingsScreen = withAuthRequired(function Settings({}: Props) { Linking.openURL(STATUS_PAGE_URL) }, []) + const clearAllStorage = React.useCallback(async () => { + await clearStorage() + Toast.show(`Storage cleared, you need to restart the app now.`) + }, []) + const clearAllLegacyStorage = React.useCallback(async () => { + await clearLegacyStorage() + Toast.show(`Legacy storage cleared, you need to restart the app now.`) + }, []) + return ( <View style={[s.hContentRegion]} testID="settingsScreen"> <ViewHeader title={_(msg`Settings`)} /> @@ -671,6 +682,28 @@ export const SettingsScreen = withAuthRequired(function Settings({}: Props) { <Trans>Reset onboarding state</Trans> </Text> </TouchableOpacity> + <TouchableOpacity + style={[pal.view, styles.linkCardNoIcon]} + onPress={clearAllLegacyStorage} + accessibilityRole="button" + accessibilityHint="Clear all legacy storage data" + accessibilityLabel={_(msg`Clear all legacy storage data`)}> + <Text type="lg" style={pal.text}> + <Trans> + Clear all legacy storage data (restart after this) + </Trans> + </Text> + </TouchableOpacity> + <TouchableOpacity + style={[pal.view, styles.linkCardNoIcon]} + onPress={clearAllStorage} + accessibilityRole="button" + accessibilityHint="Clear all storage data" + accessibilityLabel={_(msg`Clear all storage data`)}> + <Text type="lg" style={pal.text}> + <Trans>Clear all storage data (restart after this)</Trans> + </Text> + </TouchableOpacity> </> ) : null} <View style={[styles.footer]}> |