From 62ff17bf053c1e0e4aa5aa1b15044ec0d81be8c2 Mon Sep 17 00:00:00 2001 From: Alka Prasad Date: Thu, 19 Jun 2025 21:22:31 +0530 Subject: [PATCH] [INJIMOB-3319]: pass exitAppWithTimer props to decide app exist in error case for ovp same device flow (#1966) Signed-off-by: Alka Prasad --- components/ui/Error.tsx | 9 +++------ screens/Scan/SendVPScreen.tsx | 1 + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/components/ui/Error.tsx b/components/ui/Error.tsx index b61dea7f..664455eb 100644 --- a/components/ui/Error.tsx +++ b/components/ui/Error.tsx @@ -42,11 +42,7 @@ export const Error: React.FC = props => { const [triggerExitFlow, setTriggerExitFlow] = useState(false); useEffect(() => { - if ( - props.isVisible && - props.textButtonText === undefined && - props.primaryButtonText === undefined - ) { + if (props.exitAppWithTimer) { const timeout = setTimeout( () => { setTriggerExitFlow(true); @@ -56,7 +52,7 @@ export const Error: React.FC = props => { return () => clearTimeout(timeout); } - }, [props.isVisible, props.textButtonText, props.primaryButtonText]); + }, [props.exitAppWithTimer]); useEffect(() => { if (triggerExitFlow) { @@ -219,4 +215,5 @@ export interface ErrorProps { textButtonEvent?: () => void; primaryButtonTestID?: string; textButtonTestID?: string; + exitAppWithTimer?: boolean; } diff --git a/screens/Scan/SendVPScreen.tsx b/screens/Scan/SendVPScreen.tsx index 6a2a8ccd..9ea06b1d 100644 --- a/screens/Scan/SendVPScreen.tsx +++ b/screens/Scan/SendVPScreen.tsx @@ -421,6 +421,7 @@ export const SendVPScreen: React.FC = props => { textButtonEvent={handleTextButtonEvent} customImageStyles={{paddingBottom: 0, marginBottom: -6}} customStyles={{marginTop: '30%'}} + exitAppWithTimer={controller.isOVPViaDeepLink} testID={'vpShareError'} />