Skip to content

Commit

Permalink
Merge pull request #8969 from Expensify/cmartins-fixPlaidConnection
Browse files Browse the repository at this point in the history
Fix connect with Plaid on mobile
  • Loading branch information
chiragsalian authored May 12, 2022
2 parents f25c38f + 53473cc commit ef383f0
Showing 1 changed file with 7 additions and 3 deletions.
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

0 comments on commit ef383f0

Please sign in to comment.