@zeniai/client-epic-state 4.11.59 → 4.11.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,14 +6,20 @@ const operators_1 = require("rxjs/operators");
6
6
  const settingsViewReducer_1 = require("../settingsViewReducer");
7
7
  const paymentAccountListReducer_1 = require("../../spendManagement/zeniAccounts/paymentAccountList/paymentAccountListReducer");
8
8
  const depositAccountListReducer_1 = require("../../spendManagement/zeniAccounts/depositAccountList/depositAccountListReducer");
9
+ const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
9
10
  const fetchBankConnectionsViewEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchBankConnectionsView.match), (0, operators_1.mergeMap)((action) => {
11
+ var _a, _b;
10
12
  const { cacheOverride } = action.payload;
11
13
  const bankConnectionActions = [];
12
14
  const state = state$.value;
15
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
16
+ const isAccountsEnabled = Boolean((_b = (_a = currentTenant.companyZeniAccountInfo) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.isZeniAccountEnabled);
13
17
  if (cacheOverride === true) {
14
18
  bankConnectionActions.push((0, settingsViewReducer_1.fetchBankAccountsList)());
15
19
  bankConnectionActions.push((0, paymentAccountListReducer_1.fetchPaymentAccountList)());
16
- bankConnectionActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
20
+ if (isAccountsEnabled === true) {
21
+ bankConnectionActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
22
+ }
17
23
  }
18
24
  else {
19
25
  const bankAccountsList = state.settingsViewState.bankConnection;
@@ -27,7 +33,8 @@ const fetchBankConnectionsViewEpic = (actions$, state$) => actions$.pipe((0, ope
27
33
  bankConnectionActions.push((0, paymentAccountListReducer_1.fetchPaymentAccountList)());
28
34
  }
29
35
  const depositAccountList = state.depositAccountListState;
30
- if (depositAccountList.hasValidState() === false &&
36
+ if (isAccountsEnabled === true &&
37
+ depositAccountList.hasValidState() === false &&
31
38
  depositAccountList.fetchState !== 'In-Progress') {
32
39
  bankConnectionActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
33
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.11.59",
3
+ "version": "4.11.61",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",