about summary refs log tree commit diff
path: root/src/view/screens/AppPasswords.tsx
diff options
context:
space:
mode:
authorAnsh <anshnanda10@gmail.com>2023-04-25 12:01:47 -0700
committerGitHub <noreply@github.com>2023-04-25 14:01:47 -0500
commit01410ad4bfb5e49aa954ee2e65964a43b1aaf401 (patch)
tree551fb734cef583d7d4a6fc195fea5d3cb058024d /src/view/screens/AppPasswords.tsx
parentb00365c196ba4709f90e9d90b0f8757248c0189e (diff)
downloadvoidsky-01410ad4bfb5e49aa954ee2e65964a43b1aaf401.tar.zst
create Alert.tsx and Alert.web.tsx and replace uses (#513)
Diffstat (limited to 'src/view/screens/AppPasswords.tsx')
-rw-r--r--src/view/screens/AppPasswords.tsx44
1 files changed, 19 insertions, 25 deletions
diff --git a/src/view/screens/AppPasswords.tsx b/src/view/screens/AppPasswords.tsx
index db8ee98ba..f957a45e0 100644
--- a/src/view/screens/AppPasswords.tsx
+++ b/src/view/screens/AppPasswords.tsx
@@ -1,5 +1,6 @@
 import React from 'react'
-import {Alert, StyleSheet, TouchableOpacity, View} from 'react-native'
+import {StyleSheet, TouchableOpacity, View} from 'react-native'
+import {Alert} from 'view/com/util/Alert'
 import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
 import {ScrollView} from 'react-native-gesture-handler'
 import {Text} from '../com/util/text/Text'
@@ -159,31 +160,24 @@ function AppPassword({
   const store = useStores()
 
   const onDelete = React.useCallback(async () => {
-    if (isDesktopWeb) {
-      if (confirm('Delete app password?')) {
-        await store.me.deleteAppPassword(name)
-        Toast.show('App password deleted')
-      }
-    } else {
-      Alert.alert(
-        'Delete App Password',
-        `Are you sure you want to delete the app password "${name}"?`,
-        [
-          {
-            text: 'Cancel',
-            style: 'cancel',
+    Alert.alert(
+      'Delete App Password',
+      `Are you sure you want to delete the app password "${name}"?`,
+      [
+        {
+          text: 'Cancel',
+          style: 'cancel',
+        },
+        {
+          text: 'Delete',
+          style: 'destructive',
+          onPress: async () => {
+            await store.me.deleteAppPassword(name)
+            Toast.show('App password deleted')
           },
-          {
-            text: 'Delete',
-            style: 'destructive',
-            onPress: async () => {
-              await store.me.deleteAppPassword(name)
-              Toast.show('App password deleted')
-            },
-          },
-        ],
-      )
-    }
+        },
+      ],
+    )
   }, [store, name])
 
   return (