update delete app password confirmation modal (#803)
parent
a89129fcf6
commit
69bcb72061
|
@ -1,6 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {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 {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||||
import {ScrollView} from 'react-native-gesture-handler'
|
import {ScrollView} from 'react-native-gesture-handler'
|
||||||
import {Text} from '../com/util/text/Text'
|
import {Text} from '../com/util/text/Text'
|
||||||
|
@ -160,24 +159,15 @@ function AppPassword({
|
||||||
const store = useStores()
|
const store = useStores()
|
||||||
|
|
||||||
const onDelete = React.useCallback(async () => {
|
const onDelete = React.useCallback(async () => {
|
||||||
Alert.alert(
|
store.shell.openModal({
|
||||||
'Delete App Password',
|
name: 'confirm',
|
||||||
`Are you sure you want to delete the app password "${name}"?`,
|
title: 'Delete App Password',
|
||||||
[
|
message: `Are you sure you want to delete the app password "${name}"?`,
|
||||||
{
|
async onPressConfirm() {
|
||||||
text: 'Cancel',
|
await store.me.deleteAppPassword(name)
|
||||||
style: 'cancel',
|
Toast.show('App password deleted')
|
||||||
},
|
},
|
||||||
{
|
})
|
||||||
text: 'Delete',
|
|
||||||
style: 'destructive',
|
|
||||||
onPress: async () => {
|
|
||||||
await store.me.deleteAppPassword(name)
|
|
||||||
Toast.show('App password deleted')
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
)
|
|
||||||
}, [store, name])
|
}, [store, name])
|
||||||
|
|
||||||
const {contentLanguages} = store.preferences
|
const {contentLanguages} = store.preferences
|
||||||
|
|
Loading…
Reference in New Issue