From b2cc5b80871c2fd9a689f74c0de61fb8e761ecdf Mon Sep 17 00:00:00 2001 From: borys3kk Date: Wed, 10 Jun 2026 12:09:31 +0200 Subject: [PATCH] fix using isFocused --- src/components/BlockingViews/ForceFullScreenView/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/BlockingViews/ForceFullScreenView/index.tsx b/src/components/BlockingViews/ForceFullScreenView/index.tsx index f856794e4a57..a222d69f6816 100644 --- a/src/components/BlockingViews/ForceFullScreenView/index.tsx +++ b/src/components/BlockingViews/ForceFullScreenView/index.tsx @@ -1,4 +1,4 @@ -import {useRoute} from '@react-navigation/native'; +import {useIsFocused, useRoute} from '@react-navigation/native'; import React, {useEffect} from 'react'; import {View} from 'react-native'; import {useFullScreenBlockingViewActions} from '@components/FullScreenBlockingViewContextProvider'; @@ -9,16 +9,17 @@ function ForceFullScreenView({children, shouldForceFullScreen = false}: ForceFul const route = useRoute(); const styles = useThemeStyles(); const {addRouteKey, removeRouteKey} = useFullScreenBlockingViewActions(); + const isFocused = useIsFocused(); useEffect(() => { - if (!shouldForceFullScreen) { + if (!shouldForceFullScreen || !isFocused) { return; } addRouteKey(route.key); return () => removeRouteKey(route.key); - }, [addRouteKey, removeRouteKey, route.key, shouldForceFullScreen]); + }, [addRouteKey, removeRouteKey, route.key, shouldForceFullScreen, isFocused]); if (shouldForceFullScreen) { return {children};