From 8a72bf3ace7089363ccf79507e2b07134f9268e5 Mon Sep 17 00:00:00 2001 From: Hubert Sosinski Date: Wed, 17 Dec 2025 12:21:04 +0100 Subject: [PATCH] Stabilise rendering of Migrated User Modal --- src/hooks/useOnboardingFlow.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hooks/useOnboardingFlow.ts b/src/hooks/useOnboardingFlow.ts index b71795f32881..08a9c6a9555f 100644 --- a/src/hooks/useOnboardingFlow.ts +++ b/src/hooks/useOnboardingFlow.ts @@ -55,7 +55,7 @@ function useOnboardingFlowRouter() { useEffect(() => { // This should delay opening the onboarding modal so it does not interfere with the ongoing ReportScreen params changes // eslint-disable-next-line @typescript-eslint/no-deprecated - InteractionManager.runAfterInteractions(() => { + const handle = InteractionManager.runAfterInteractions(() => { // Prevent starting the onboarding flow if we are logging in as a new user with short lived token if (currentUrl?.includes(ROUTES.TRANSITION_BETWEEN_APPS) && isLoggingInAsNewSessionUser) { return; @@ -146,6 +146,10 @@ function useOnboardingFlowRouter() { }); } }); + + return () => { + handle.cancel(); + }; }, [ isLoadingApp, isHybridAppOnboardingCompleted,