Skip to content

Commit

Permalink
improve another method
Browse files Browse the repository at this point in the history
  • Loading branch information
war-in committed Dec 13, 2024
1 parent 74d0c59 commit 115ee41
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/libs/HybridApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ function handleChangeInHybridAppSignInFlow(hybridApp: OnyxEntry<HybridApp>, tryN

if (hybridApp?.newDotSignInState === CONST.HYBRID_APP_SIGN_IN_STATE.FINISHED && tryNewDot !== undefined && !!credentials?.autoGeneratedLogin && !!credentials?.autoGeneratedPassword) {
Log.info(`[HybridApp] Performing sign-in${shouldUseOldApp(tryNewDot) ? '' : ' (in background)'} on OldDot side`);
NativeModules.HybridAppModule.signInToOldDot(
credentials.autoGeneratedLogin,
credentials.autoGeneratedPassword,
currentSession?.authToken ?? '',
getCurrentUserEmail() ?? '',
activePolicyID ?? '',
);
NativeModules.HybridAppModule.signInToOldDot({
autoGeneratedLogin: credentials.autoGeneratedLogin,
autoGeneratedPassword: credentials.autoGeneratedPassword,
authToken: currentSession?.authToken ?? '',
email: getCurrentUserEmail() ?? '',
policyID: activePolicyID ?? '',
});
HybridAppActions.setUseNewDotSignInPage(false).then(() => {
if (shouldUseOldApp(tryNewDot)) {
NativeModules.HybridAppModule.closeReactNativeApp(false, false);
NativeModules.HybridAppModule.closeReactNativeApp({shouldSignOut: false, shouldSetNVP: false});
} else {
Log.info('[HybridApp] The user should see NewDot. There is no need to block the user on the `SignInPage` until the sign-in process is completed on the OldDot side.');
HybridAppActions.setReadyToShowAuthScreens(true);
Expand Down

0 comments on commit 115ee41

Please sign in to comment.