Skip to content

Commit 911e22b

Browse files
chiragsalianOSBotify
authored andcommitted
Merge pull request #8969 from Expensify/cmartins-fixPlaidConnection
Fix connect with Plaid on mobile (cherry picked from commit ef383f0)
1 parent 6e91c0c commit 911e22b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/libs/actions/App.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ AppState.addEventListener('change', (nextAppState) => {
9191
* Fetches data needed for app initialization
9292
*
9393
* @param {Boolean} shouldSyncPolicyList Should be false if the initial policy needs to be created. Otherwise, should be true.
94+
* @param {Boolean} shouldSyncVBA Set to false if we are calling on reconnect.
9495
* @returns {Promise}
9596
*/
96-
function getAppData(shouldSyncPolicyList = true) {
97+
function getAppData(shouldSyncPolicyList = true, shouldSyncVBA = true) {
9798
NameValuePair.get(CONST.NVP.PRIORITY_MODE, ONYXKEYS.NVP_PRIORITY_MODE, 'default');
9899
NameValuePair.get(CONST.NVP.IS_FIRST_TIME_NEW_EXPENSIFY_USER, ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER, true);
99100
getLocale();
@@ -102,9 +103,12 @@ function getAppData(shouldSyncPolicyList = true) {
102103
User.getDomainInfo();
103104
PersonalDetails.fetchLocalCurrency();
104105
GeoLocation.fetchCountryCodeByRequestIP();
105-
BankAccounts.fetchFreePlanVerifiedBankAccount();
106106
BankAccounts.fetchUserWallet();
107107

108+
if (shouldSyncVBA) {
109+
BankAccounts.fetchFreePlanVerifiedBankAccount();
110+
}
111+
108112
if (shouldSyncPolicyList) {
109113
Policy.getPolicyList();
110114
}
@@ -117,7 +121,7 @@ function getAppData(shouldSyncPolicyList = true) {
117121
}
118122

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

122126
export {
123127
setCurrentURL,

0 commit comments

Comments
 (0)