From b4120c048363416105a80ff4d6ea5fe77adc4d3a Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 9 Aug 2022 13:21:28 +0200 Subject: [PATCH] Main: Prevent refreshing layout during phone call (#1991) --- src/components/main/Main.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/main/Main.tsx b/src/components/main/Main.tsx index ead646d8d..772bd2ed8 100644 --- a/src/components/main/Main.tsx +++ b/src/components/main/Main.tsx @@ -258,7 +258,7 @@ const Main: FC = ({ // Prevent refresh by accidentally rotating device when listening to a voice chat useEffect(() => { - if (!activeGroupCallId) { + if (!activeGroupCallId && !isPhoneCallActive) { return undefined; } @@ -267,7 +267,7 @@ const Main: FC = ({ return () => { windowSize.enableRefresh(); }; - }, [activeGroupCallId]); + }, [activeGroupCallId, isPhoneCallActive]); const leftColumnTransition = useShowTransition( isLeftColumnOpen, undefined, true, undefined, shouldSkipHistoryAnimations,