Skip to content

Commit

Permalink
Change concat to push
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuuszzzzz committed Dec 4, 2024
1 parent 4559682 commit 9d4186d
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/libs/actions/Session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,15 @@ function hybridAppSignInAttemptState(): OnyxData {
newDotSignInState: CONST.HYBRID_APP_SIGN_IN_STATE.FINISHED,
},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.NVP_TRYNEWDOT, // Temporary mock to make development easier. Remove when backend is ready.
value: {
classicRedirect: {
dismissed: true,
},
},
},
],
failureData: [
{
Expand Down Expand Up @@ -574,11 +583,12 @@ function beginAppleSignIn(idToken: string | undefined | null) {
const {optimisticData, successData, failureData} = signInAttemptState();

if (NativeModules.HybridAppModule) {
Log.info('[HybridApp] Extending `signInAttemptState` with HybridApp data');
const {optimisticData: hybridAppOptimisticData, successData: hybridAppSuccessData, failureData: hybridAppFailureData} = hybridAppSignInAttemptState();

optimisticData.concat(hybridAppOptimisticData);
successData.concat(hybridAppSuccessData);
failureData.concat(hybridAppFailureData);
optimisticData.push(...hybridAppOptimisticData);
successData.push(...hybridAppSuccessData);
failureData.push(...hybridAppFailureData);
}

const params: BeginAppleSignInParams = {idToken, preferredLocale};
Expand All @@ -594,11 +604,12 @@ function beginGoogleSignIn(token: string | null) {
const {optimisticData, successData, failureData} = signInAttemptState();

if (NativeModules.HybridAppModule) {
Log.info('[HybridApp] Extending `signInAttemptState` with HybridApp data');
const {optimisticData: hybridAppOptimisticData, successData: hybridAppSuccessData, failureData: hybridAppFailureData} = hybridAppSignInAttemptState();

optimisticData.concat(hybridAppOptimisticData);
successData.concat(hybridAppSuccessData);
failureData.concat(hybridAppFailureData);
optimisticData.push(...hybridAppOptimisticData);
successData.push(...hybridAppSuccessData);
failureData.push(...hybridAppFailureData);
}

const params: BeginGoogleSignInParams = {token, preferredLocale};
Expand Down

0 comments on commit 9d4186d

Please sign in to comment.