diff options
Diffstat (limited to 'src/screens')
-rw-r--r-- | src/screens/Messages/Conversation.tsx | 13 | ||||
-rw-r--r-- | src/screens/StarterPack/Wizard/index.tsx | 13 |
2 files changed, 7 insertions, 19 deletions
diff --git a/src/screens/Messages/Conversation.tsx b/src/screens/Messages/Conversation.tsx index ee09adaf0..a2157d2b9 100644 --- a/src/screens/Messages/Conversation.tsx +++ b/src/screens/Messages/Conversation.tsx @@ -1,6 +1,5 @@ import React, {useCallback} from 'react' import {View} from 'react-native' -import {useKeyboardController} from 'react-native-keyboard-controller' import {AppBskyActorDefs, moderateProfile, ModerationOpts} from '@atproto/api' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -8,6 +7,7 @@ import {useFocusEffect, useNavigation} from '@react-navigation/native' import {NativeStackScreenProps} from '@react-navigation/native-stack' import {useEmail} from '#/lib/hooks/useEmail' +import {useEnableKeyboardControllerScreen} from '#/lib/hooks/useEnableKeyboardController' import {CommonNavigatorParams, NavigationProp} from '#/lib/routes/types' import {isWeb} from '#/platform/detection' import {useProfileShadow} from '#/state/cache/profile-shadow' @@ -39,16 +39,7 @@ export function MessagesConversationScreen({route}: Props) { const convoId = route.params.conversation const {setCurrentConvoId} = useCurrentConvoId() - const {setEnabled} = useKeyboardController() - useFocusEffect( - useCallback(() => { - if (isWeb) return - setEnabled(true) - return () => { - setEnabled(false) - } - }, [setEnabled]), - ) + useEnableKeyboardControllerScreen(true) useFocusEffect( useCallback(() => { diff --git a/src/screens/StarterPack/Wizard/index.tsx b/src/screens/StarterPack/Wizard/index.tsx index 9a90a1f51..b0d71b929 100644 --- a/src/screens/StarterPack/Wizard/index.tsx +++ b/src/screens/StarterPack/Wizard/index.tsx @@ -1,9 +1,6 @@ import React from 'react' import {Keyboard, TouchableOpacity, View} from 'react-native' -import { - KeyboardAwareScrollView, - useKeyboardController, -} from 'react-native-keyboard-controller' +import {KeyboardAwareScrollView} from 'react-native-keyboard-controller' import {useSafeAreaInsets} from 'react-native-safe-area-context' import {Image} from 'expo-image' import { @@ -20,6 +17,7 @@ import {useFocusEffect, useNavigation} from '@react-navigation/native' import {NativeStackScreenProps} from '@react-navigation/native-stack' import {HITSLOP_10, STARTER_PACK_MAX_SIZE} from '#/lib/constants' +import {useEnableKeyboardControllerScreen} from '#/lib/hooks/useEnableKeyboardController' import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name' import {CommonNavigatorParams, NavigationProp} from '#/lib/routes/types' import {logEvent} from '#/lib/statsig/statsig' @@ -151,7 +149,6 @@ function WizardInner({ const {_} = useLingui() const t = useTheme() const setMinimalShellMode = useSetMinimalShellMode() - const {setEnabled} = useKeyboardController() const [state, dispatch] = useWizardState() const {currentAccount} = useSession() const {data: currentProfile} = useProfileQuery({ @@ -166,16 +163,16 @@ function WizardInner({ }) }, [navigation]) + useEnableKeyboardControllerScreen(true) + useFocusEffect( React.useCallback(() => { - setEnabled(true) setMinimalShellMode(true) return () => { setMinimalShellMode(false) - setEnabled(false) } - }, [setMinimalShellMode, setEnabled]), + }, [setMinimalShellMode]), ) const getDefaultName = () => { |