@@ -25,23 +25,6 @@ function resetSessionFlag() {
2525 hasRedirectedToMigratedUserModal = false ;
2626}
2727
28- let pendingNavigationCheck : ReturnType < typeof setTimeout > | undefined ;
29-
30- /**
31- * Schedules a deferred navigation check. The check is deferred to the next event loop tick
32- * so it doesn't run synchronously inside Onyx callbacks, which would interfere with
33- * Onyx batch processing and cause extra component renders.
34- */
35- function scheduleNavigationCheck ( ) {
36- if ( pendingNavigationCheck !== undefined ) {
37- return ;
38- }
39- pendingNavigationCheck = setTimeout ( ( ) => {
40- pendingNavigationCheck = undefined ;
41- navigateToMigratedUserWelcomeModalIfReady ( ) ;
42- } , 0 ) ;
43- }
44-
4528/**
4629 * Proactively navigate to the migrated user welcome modal when all conditions are met,
4730 * without waiting for a user-initiated navigation action.
@@ -70,15 +53,15 @@ function navigateToMigratedUserWelcomeModalIfReady() {
7053function onSessionOrLoadingAppChanged ( sessionValue : OnyxEntry < Session > , isLoadingAppValue : boolean ) {
7154 session = sessionValue ;
7255 isLoadingApp = isLoadingAppValue ;
73- scheduleNavigationCheck ( ) ;
56+ navigateToMigratedUserWelcomeModalIfReady ( ) ;
7457}
7558
7659Onyx . connectWithoutView ( {
7760 key : ONYXKEYS . NVP_TRY_NEW_DOT ,
7861 callback : ( value ) => {
7962 const result = value ? tryNewDotOnyxSelector ( value ) : undefined ;
8063 hasBeenAddedToNudgeMigration = result ?. hasBeenAddedToNudgeMigration ?? false ;
81- scheduleNavigationCheck ( ) ;
64+ navigateToMigratedUserWelcomeModalIfReady ( ) ;
8265 } ,
8366} ) ;
8467
0 commit comments