Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix connect with Plaid on mobile #8969

Merged
merged 1 commit into from
May 12, 2022
Merged
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
10 changes: 7 additions & 3 deletions src/libs/actions/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ AppState.addEventListener('change', (nextAppState) => {
* Fetches data needed for app initialization
*
* @param {Boolean} shouldSyncPolicyList Should be false if the initial policy needs to be created. Otherwise, should be true.
* @param {Boolean} shouldSyncVBA Set to false if we are calling on reconnect.
* @returns {Promise}
*/
function getAppData(shouldSyncPolicyList = true) {
function getAppData(shouldSyncPolicyList = true, shouldSyncVBA = true) {
NameValuePair.get(CONST.NVP.PRIORITY_MODE, ONYXKEYS.NVP_PRIORITY_MODE, 'default');
NameValuePair.get(CONST.NVP.IS_FIRST_TIME_NEW_EXPENSIFY_USER, ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER, true);
getLocale();
Expand All @@ -102,9 +103,12 @@ function getAppData(shouldSyncPolicyList = true) {
User.getDomainInfo();
PersonalDetails.fetchLocalCurrency();
GeoLocation.fetchCountryCodeByRequestIP();
BankAccounts.fetchFreePlanVerifiedBankAccount();
BankAccounts.fetchUserWallet();

if (shouldSyncVBA) {
BankAccounts.fetchFreePlanVerifiedBankAccount();
}

if (shouldSyncPolicyList) {
Policy.getPolicyList();
}
Expand Down Expand Up @@ -132,7 +136,7 @@ function fixAccountAndReloadData() {
}

// When the app reconnects from being offline, fetch all initialization data
NetworkConnection.onReconnect(getAppData);
NetworkConnection.onReconnect(() => getAppData(true, false));

export {
setCurrentURL,
Expand Down