Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/libs/API/parameters/BeginSignInParams.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
type BeginSignInParams = {
email: string;
deviceInfo: string;
};

export default BeginSignInParams;
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
type RequestAccountValidationLinkParams = {
email?: string;
deviceInfo: string;
};

export default RequestAccountValidationLinkParams;
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
type RequestContactMethodValidateCodeParams = {email: string};
type RequestContactMethodValidateCodeParams = {
email: string;
deviceInfo: string;
};

export default RequestContactMethodValidateCodeParams;
1 change: 1 addition & 0 deletions src/libs/API/parameters/RequestNewValidateCodeParams.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
type RequestNewValidateCodeParams = {
email?: string;
deviceInfo: string;
};

export default RequestNewValidateCodeParams;
14 changes: 8 additions & 6 deletions src/libs/actions/Session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
import type Session from '@src/types/onyx/Session';
import type {AutoAuthState} from '@src/types/onyx/Session';
import pkg from '../../../../package.json';
import {clearCachedAttachments} from '../Attachment';

Check warning on line 72 in src/libs/actions/Session/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Unexpected parent import '../Attachment'. Use '@userActions/Attachment' instead
import clearCache from './clearCache';
import updateSessionAuthTokens from './updateSessionAuthTokens';

Expand All @@ -81,7 +81,7 @@
let isHybridAppSetupFinished = false;
let hasSwitchedAccountInHybridMode = false;

Onyx.connect({

Check warning on line 84 in src/libs/actions/Session/index.ts

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) => {
session = value ?? {};
Expand All @@ -106,13 +106,13 @@
});

let stashedSession: Session = {};
Onyx.connect({

Check warning on line 109 in src/libs/actions/Session/index.ts

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.STASHED_SESSION,
callback: (value) => (stashedSession = value ?? {}),
});

let credentials: Credentials = {};
Onyx.connect({

Check warning on line 115 in src/libs/actions/Session/index.ts

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.CREDENTIALS,
callback: (value) => (credentials = value ?? {}),
});
Expand Down Expand Up @@ -517,9 +517,10 @@
},
];

const params: RequestNewValidateCodeParams = {email: login};

API.write(WRITE_COMMANDS.REQUEST_NEW_VALIDATE_CODE, params, {optimisticData, finallyData});
Device.getDeviceInfoWithID().then((deviceInfo) => {
const params: RequestNewValidateCodeParams = {email: login, deviceInfo};
API.write(WRITE_COMMANDS.REQUEST_NEW_VALIDATE_CODE, params, {optimisticData, finallyData});
});
}

/**
Expand Down Expand Up @@ -576,9 +577,10 @@
function beginSignIn(email: string) {
const {optimisticData, successData, failureData} = signInAttemptState();

const params: BeginSignInParams = {email};

API.read(READ_COMMANDS.BEGIN_SIGNIN, params, {optimisticData, successData, failureData});
Device.getDeviceInfoWithID().then((deviceInfo) => {
const params: BeginSignInParams = {email, deviceInfo};
API.read(READ_COMMANDS.BEGIN_SIGNIN, params, {optimisticData, successData, failureData});
});
}

/**
Expand Down
8 changes: 5 additions & 3 deletions src/libs/actions/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import * as ReportUtils from '@libs/ReportUtils';
import playSound, {SOUNDS} from '@libs/Sound';
import Visibility from '@libs/Visibility';
import * as Device from '@userActions/Device';

Check warning on line 47 in src/libs/actions/User.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Unexpected subpath import via alias '@userActions/Device'. Use './Device' instead
import CONFIG from '@src/CONFIG';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
Expand All @@ -66,7 +67,7 @@

let currentUserAccountID = -1;
let currentEmail = '';
Onyx.connect({

Check warning on line 70 in src/libs/actions/User.ts

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) => {
currentUserAccountID = value?.accountID ?? CONST.DEFAULT_NUMBER_ID;
Expand Down Expand Up @@ -187,9 +188,10 @@
},
];

const parameters: RequestContactMethodValidateCodeParams = {email: contactMethod};

API.write(WRITE_COMMANDS.REQUEST_CONTACT_METHOD_VALIDATE_CODE, parameters, {optimisticData, successData, failureData});
Device.getDeviceInfoWithID().then((deviceInfo) => {
const parameters: RequestContactMethodValidateCodeParams = {email: contactMethod, deviceInfo};
API.write(WRITE_COMMANDS.REQUEST_CONTACT_METHOD_VALIDATE_CODE, parameters, {optimisticData, successData, failureData});
});
}

/**
Expand Down
Loading