about summary refs log tree commit diff
path: root/src/view/screens/Settings.tsx
diff options
context:
space:
mode:
authorAnsh Nanda <anshnanda10@gmail.com>2023-05-23 14:18:35 -0700
committerAnsh Nanda <anshnanda10@gmail.com>2023-05-23 14:18:35 -0700
commitb561a51ed9f798194c3c6a72eefab562a773f2c9 (patch)
tree1cede1243bddef26b4f619e933246cc80b667ad5 /src/view/screens/Settings.tsx
parent52a8879754e07c3e0aa90a40fdc27dfdc40fd450 (diff)
downloadvoidsky-b561a51ed9f798194c3c6a72eefab562a773f2c9.tar.zst
add button to reset preferences in dev mode
Diffstat (limited to 'src/view/screens/Settings.tsx')
-rw-r--r--src/view/screens/Settings.tsx15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/view/screens/Settings.tsx b/src/view/screens/Settings.tsx
index 3ce41f8c0..ac4e5a9e0 100644
--- a/src/view/screens/Settings.tsx
+++ b/src/view/screens/Settings.tsx
@@ -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>