diff options
Diffstat (limited to 'src/view/screens/AppPasswords.tsx')
-rw-r--r-- | src/view/screens/AppPasswords.tsx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/view/screens/AppPasswords.tsx b/src/view/screens/AppPasswords.tsx index b654055c4..338adfbaf 100644 --- a/src/view/screens/AppPasswords.tsx +++ b/src/view/screens/AppPasswords.tsx @@ -17,6 +17,7 @@ import {useFocusEffect} from '@react-navigation/native' import {ViewHeader} from '../com/util/ViewHeader' import {CenteredView} from 'view/com/util/Views' import {useSetMinimalShellMode} from '#/state/shell' +import {useModalControls} from '#/state/modals' import {useLanguagePrefs} from '#/state/preferences' type Props = NativeStackScreenProps<CommonNavigatorParams, 'AppPasswords'> @@ -27,6 +28,7 @@ export const AppPasswords = withAuthRequired( const setMinimalShellMode = useSetMinimalShellMode() const {screen} = useAnalytics() const {isTabletOrDesktop} = useWebMediaQueries() + const {openModal} = useModalControls() useFocusEffect( React.useCallback(() => { @@ -36,8 +38,8 @@ export const AppPasswords = withAuthRequired( ) const onAdd = React.useCallback(async () => { - store.shell.openModal({name: 'add-app-password'}) - }, [store]) + openModal({name: 'add-app-password'}) + }, [openModal]) // no app passwords (empty) state if (store.me.appPasswords.length === 0) { @@ -162,10 +164,11 @@ function AppPassword({ }) { const pal = usePalette('default') const store = useStores() + const {openModal} = useModalControls() const {contentLanguages} = useLanguagePrefs() const onDelete = React.useCallback(async () => { - store.shell.openModal({ + openModal({ name: 'confirm', title: 'Delete App Password', message: `Are you sure you want to delete the app password "${name}"?`, @@ -174,7 +177,7 @@ function AppPassword({ Toast.show('App password deleted') }, }) - }, [store, name]) + }, [store, openModal, name]) const primaryLocale = contentLanguages.length > 0 ? contentLanguages[0] : 'en-US' |