about summary refs log tree commit diff
path: root/src/view/screens/Settings/index.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-08-06 00:30:58 +0100
committerGitHub <noreply@github.com>2024-08-06 00:30:58 +0100
commit5bf7f3769d005e7e606e4b10327eb7467f59f0aa (patch)
tree1e1e2d1bb011b25a9153f39d8ba5f2281b0e1105 /src/view/screens/Settings/index.tsx
parent74b0318d89b5ec4746cd4861f8573ea24c6ccea1 (diff)
downloadvoidsky-5bf7f3769d005e7e606e4b10327eb7467f59f0aa.tar.zst
[Persisted] Fork web and native, make it synchronous on the web (#4872)
* Delete logic for legacy storage

* Delete superfluous tests

At this point these tests aren't testing anything useful, let's just get rid of them.

* Inline store.ts methods into persisted/index.ts

* Fork persisted/index.ts into index.web.ts

* Remove non-essential code and comments from both forks

* Remove async/await from web fork of persisted/index.ts

* Remove unused return

* Enforce that forked types match
Diffstat (limited to 'src/view/screens/Settings/index.tsx')
-rw-r--r--src/view/screens/Settings/index.tsx19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/view/screens/Settings/index.tsx b/src/view/screens/Settings/index.tsx
index c33be7d54..a75fec546 100644
--- a/src/view/screens/Settings/index.tsx
+++ b/src/view/screens/Settings/index.tsx
@@ -20,8 +20,7 @@ import {useQueryClient} from '@tanstack/react-query'
 
 import {isNative} from '#/platform/detection'
 import {useModalControls} from '#/state/modals'
-import {clearLegacyStorage} from '#/state/persisted/legacy'
-import {clear as clearStorage} from '#/state/persisted/store'
+import {clearStorage} from '#/state/persisted'
 import {
   useInAppBrowser,
   useSetInAppBrowser,
@@ -299,10 +298,6 @@ export function SettingsScreen({}: Props) {
     await clearStorage()
     Toast.show(_(msg`Storage cleared, you need to restart the app now.`))
   }, [_])
-  const clearAllLegacyStorage = React.useCallback(async () => {
-    await clearLegacyStorage()
-    Toast.show(_(msg`Legacy storage cleared, you need to restart the app now.`))
-  }, [_])
 
   const deactivateAccountControl = useDialogControl()
   const onPressDeactivateAccount = React.useCallback(() => {
@@ -865,18 +860,6 @@ export function SettingsScreen({}: Props) {
             </TouchableOpacity>
             <TouchableOpacity
               style={[pal.view, styles.linkCardNoIcon]}
-              onPress={clearAllLegacyStorage}
-              accessibilityRole="button"
-              accessibilityLabel={_(msg`Clear all legacy storage data`)}
-              accessibilityHint={_(msg`Clears 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"
               accessibilityLabel={_(msg`Clear all storage data`)}