diff --git a/src/components/Lottie/index.tsx b/src/components/Lottie/index.tsx index a6b1374b1c8f..9fb61ea99f75 100644 --- a/src/components/Lottie/index.tsx +++ b/src/components/Lottie/index.tsx @@ -8,7 +8,7 @@ import type DotLottieAnimation from '@components/LottieAnimations/types'; import useAppState from '@hooks/useAppState'; import useNetwork from '@hooks/useNetwork'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as Browser from '@libs/Browser'; +import {getBrowser, isMobile} from '@libs/Browser'; import isSideModalNavigator from '@libs/Navigation/isSideModalNavigator'; import CONST from '@src/CONST'; import {useSplashScreenStateContext} from '@src/SplashScreenStateContext'; @@ -51,7 +51,7 @@ function Lottie({source, webStyle, shouldLoadAfterInteractions, ...props}: Props const aspectRatioStyle = styles.aspectRatioLottie(source); - const browser = Browser.getBrowser(); + const browser = getBrowser(); const [hasNavigatedAway, setHasNavigatedAway] = React.useState(false); const navigationContainerRef = useContext(NavigationContainerRefContext); const navigator = useContext(NavigationContext); @@ -74,7 +74,7 @@ function Lottie({source, webStyle, shouldLoadAfterInteractions, ...props}: Props const unsubscribeNavigationBlur = navigator.addListener('blur', () => { const state = navigationContainerRef.getRootState(); const targetRouteName = state?.routes?.[state?.index ?? 0]?.name; - if (!isSideModalNavigator(targetRouteName)) { + if (!isSideModalNavigator(targetRouteName) || isMobile()) { setHasNavigatedAway(true); } });