using keepawake hook

This commit is contained in:
Roland Osborne 2022-10-19 14:49:28 -07:00
parent 8c01f67b5d
commit 7799064039

View File

@ -1,5 +1,5 @@
import { KeyboardAvoidingView, Modal, Platform, TextInput, View, TouchableOpacity, Text, } from 'react-native'; import { KeyboardAvoidingView, Modal, Platform, TextInput, View, TouchableOpacity, Text, } from 'react-native';
import { activateKeepAwake, deactivateKeepAwake } from 'expo-keep-awake'; import { useKeepAwake } from 'expo-keep-awake';
import { FlatList, ScrollView } from '@stream-io/flat-list-mvcp'; import { FlatList, ScrollView } from '@stream-io/flat-list-mvcp';
import { memo, useState, useRef, useEffect } from 'react'; import { memo, useState, useRef, useEffect } from 'react';
import { useConversation } from './useConversation.hook'; import { useConversation } from './useConversation.hook';
@ -39,10 +39,7 @@ export function ConversationBody() {
const ref = useRef(); const ref = useRef();
useEffect(() => { useKeepAwake();
activateKeepAwake();
return () => { deactivateKeepAwake() };
}, []);
const latch = () => { const latch = () => {
if (!state.momentum) { if (!state.momentum) {