diff options
author | GitStart <1501599+gitstart@users.noreply.github.com> | 2023-05-30 19:56:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-30 13:56:30 -0500 |
commit | 69bcb72061248b269356274c4193c45cae654ca4 (patch) | |
tree | e6bd72db7fe84daf86059f3f67a9ff59bc6b7f98 /src | |
parent | a89129fcf678195f84b0497573c77614f7def9e6 (diff) | |
download | voidsky-69bcb72061248b269356274c4193c45cae654ca4.tar.zst |
update delete app password confirmation modal (#803)
Diffstat (limited to 'src')
-rw-r--r-- | src/view/screens/AppPasswords.tsx | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/src/view/screens/AppPasswords.tsx b/src/view/screens/AppPasswords.tsx index 3adbf09df..ca60787d5 100644 --- a/src/view/screens/AppPasswords.tsx +++ b/src/view/screens/AppPasswords.tsx @@ -1,6 +1,5 @@ import React from 'react' 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' @@ -160,24 +159,15 @@ function AppPassword({ const store = useStores() const onDelete = React.useCallback(async () => { - 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') - }, - }, - ], - ) + store.shell.openModal({ + name: 'confirm', + title: 'Delete App Password', + message: `Are you sure you want to delete the app password "${name}"?`, + async onPressConfirm() { + await store.me.deleteAppPassword(name) + Toast.show('App password deleted') + }, + }) }, [store, name]) const {contentLanguages} = store.preferences |