From 77990640396cedf832fff2842d6d0ca265e723ce Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Wed, 19 Oct 2022 14:49:28 -0700 Subject: [PATCH] using keepawake hook --- app/mobile/src/session/conversation/Conversation.jsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/mobile/src/session/conversation/Conversation.jsx b/app/mobile/src/session/conversation/Conversation.jsx index c149b172..d5aa148f 100644 --- a/app/mobile/src/session/conversation/Conversation.jsx +++ b/app/mobile/src/session/conversation/Conversation.jsx @@ -1,5 +1,5 @@ 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 { memo, useState, useRef, useEffect } from 'react'; import { useConversation } from './useConversation.hook'; @@ -39,10 +39,7 @@ export function ConversationBody() { const ref = useRef(); - useEffect(() => { - activateKeepAwake(); - return () => { deactivateKeepAwake() }; - }, []); + useKeepAwake(); const latch = () => { if (!state.momentum) {