add button to reset preferences in dev mode

This commit is contained in:
Ansh Nanda 2023-05-23 14:18:35 -07:00
parent 52a8879754
commit b561a51ed9
2 changed files with 47 additions and 0 deletions

View file

@ -141,6 +141,11 @@ export const SettingsScreen = withAuthRequired(
store.shell.openModal({name: 'delete-account'})
}, [store])
const onPressResetPreferences = React.useCallback(async () => {
await store.preferences.reset()
Toast.show('Preferences reset')
}, [store])
return (
<View style={[s.hContentRegion]} testID="settingsScreen">
<ViewHeader title="Settings" />
@ -393,6 +398,16 @@ export const SettingsScreen = withAuthRequired(
Storybook
</Text>
</Link>
{__DEV__ ? (
<Link
style={[pal.view, styles.linkCardNoIcon]}
onPress={onPressResetPreferences}
title="Debug tools">
<Text type="lg" style={pal.text}>
Reset preferences state
</Text>
</Link>
) : null}
<Text type="sm" style={[styles.buildInfo, pal.textLight]}>
Build version {AppInfo.appVersion} ({AppInfo.buildVersion})
</Text>