diff options
author | Ansh <anshnanda10@gmail.com> | 2023-04-25 12:01:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-25 14:01:47 -0500 |
commit | 01410ad4bfb5e49aa954ee2e65964a43b1aaf401 (patch) | |
tree | 551fb734cef583d7d4a6fc195fea5d3cb058024d /src/view/screens/AppPasswords.tsx | |
parent | b00365c196ba4709f90e9d90b0f8757248c0189e (diff) | |
download | voidsky-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.tsx | 44 |
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 ( |