mirror of https://github.com/tooot-app/app
Fix new keyboard API
This commit is contained in:
parent
83433dd434
commit
567a09d6c6
|
@ -55,20 +55,18 @@ const ScreenCompose: React.FC<RootStackScreenProps<'Screen-Compose'>> = ({
|
||||||
|
|
||||||
const [hasKeyboard, setHasKeyboard] = useState(false)
|
const [hasKeyboard, setHasKeyboard] = useState(false)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Keyboard.addListener('keyboardWillShow', _keyboardDidShow)
|
const keyboardShown = Keyboard.addListener('keyboardWillShow', () =>
|
||||||
Keyboard.addListener('keyboardWillHide', _keyboardDidHide)
|
setHasKeyboard(true)
|
||||||
|
)
|
||||||
|
const keyboardHidden = Keyboard.addListener('keyboardWillHide', () =>
|
||||||
|
setHasKeyboard(false)
|
||||||
|
)
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
Keyboard.removeListener('keyboardWillShow', _keyboardDidShow)
|
keyboardShown.remove()
|
||||||
Keyboard.removeListener('keyboardWillHide', _keyboardDidHide)
|
keyboardHidden.remove()
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
const _keyboardDidShow = () => {
|
|
||||||
setHasKeyboard(true)
|
|
||||||
}
|
|
||||||
const _keyboardDidHide = () => {
|
|
||||||
setHasKeyboard(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
const localAccount = useSelector(getInstanceAccount, (prev, next) =>
|
const localAccount = useSelector(getInstanceAccount, (prev, next) =>
|
||||||
prev?.preferences && next?.preferences
|
prev?.preferences && next?.preferences
|
||||||
|
|
Loading…
Reference in New Issue