Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions src/libs/Navigation/AppNavigator/AuthScreens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
let isLoadingApp = false;
let lastUpdateIDAppliedToClient: OnyxEntry<number>;

Onyx.connect({

Check warning on line 125 in src/libs/Navigation/AppNavigator/AuthScreens.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, val hasn't accountID
Expand All @@ -141,7 +141,7 @@
},
});

Onyx.connect({

Check warning on line 144 in src/libs/Navigation/AppNavigator/AuthScreens.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
if (!value || !isEmptyObject(timezone)) {
Expand All @@ -162,14 +162,14 @@
},
});

Onyx.connect({

Check warning on line 165 in src/libs/Navigation/AppNavigator/AuthScreens.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.IS_LOADING_APP,
callback: (value) => {
isLoadingApp = !!value;
},
});

Onyx.connect({

Check warning on line 172 in src/libs/Navigation/AppNavigator/AuthScreens.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT,
callback: (value) => {
lastUpdateIDAppliedToClient = value;
Expand Down Expand Up @@ -308,23 +308,26 @@
init();
}

// If we are on this screen then we are "logged in", but the user might not have "just logged in". They could be reopening the app
// or returning from background. If so, we'll assume they have some app data already and we can call reconnectApp() instead of openApp() and connect() for delegator from OldDot.
if (SessionUtils.didUserLogInDuringSession() || delegatorEmail) {
if (delegatorEmail) {
connect(delegatorEmail, true)
?.then((success) => {
App.setAppLoading(!!success);
})
.finally(() => {
setIsDelegatorFromOldDotIsReady(true);
});
// In Hybrid App we decide to call one of those method when booting ND and we don't want to duplicate calls
if (!CONFIG.IS_HYBRID_APP) {
// If we are on this screen then we are "logged in", but the user might not have "just logged in". They could be reopening the app
// or returning from background. If so, we'll assume they have some app data already and we can call reconnectApp() instead of openApp() and connect() for delegator from OldDot.
if (SessionUtils.didUserLogInDuringSession() || delegatorEmail) {
if (delegatorEmail) {
connect(delegatorEmail, true)
?.then((success) => {
App.setAppLoading(!!success);
})
.finally(() => {
setIsDelegatorFromOldDotIsReady(true);
});
} else {
App.openApp();
}
} else {
App.openApp();
Log.info('[AuthScreens] Sending ReconnectApp');
App.reconnectApp(initialLastUpdateIDAppliedToClient);
}
} else {
Log.info('[AuthScreens] Sending ReconnectApp');
App.reconnectApp(initialLastUpdateIDAppliedToClient);
}

App.setUpPoliciesAndNavigate(session);
Expand Down
Loading