@@ -91,9 +91,10 @@ AppState.addEventListener('change', (nextAppState) => {
91
91
* Fetches data needed for app initialization
92
92
*
93
93
* @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.
94
95
* @returns {Promise }
95
96
*/
96
- function getAppData ( shouldSyncPolicyList = true ) {
97
+ function getAppData ( shouldSyncPolicyList = true , shouldSyncVBA = true ) {
97
98
NameValuePair . get ( CONST . NVP . PRIORITY_MODE , ONYXKEYS . NVP_PRIORITY_MODE , 'default' ) ;
98
99
NameValuePair . get ( CONST . NVP . IS_FIRST_TIME_NEW_EXPENSIFY_USER , ONYXKEYS . NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER , true ) ;
99
100
getLocale ( ) ;
@@ -102,9 +103,12 @@ function getAppData(shouldSyncPolicyList = true) {
102
103
User . getDomainInfo ( ) ;
103
104
PersonalDetails . fetchLocalCurrency ( ) ;
104
105
GeoLocation . fetchCountryCodeByRequestIP ( ) ;
105
- BankAccounts . fetchFreePlanVerifiedBankAccount ( ) ;
106
106
BankAccounts . fetchUserWallet ( ) ;
107
107
108
+ if ( shouldSyncVBA ) {
109
+ BankAccounts . fetchFreePlanVerifiedBankAccount ( ) ;
110
+ }
111
+
108
112
if ( shouldSyncPolicyList ) {
109
113
Policy . getPolicyList ( ) ;
110
114
}
@@ -132,7 +136,7 @@ function fixAccountAndReloadData() {
132
136
}
133
137
134
138
// When the app reconnects from being offline, fetch all initialization data
135
- NetworkConnection . onReconnect ( getAppData ) ;
139
+ NetworkConnection . onReconnect ( ( ) => getAppData ( true , false ) ) ;
136
140
137
141
export {
138
142
setCurrentURL ,
0 commit comments