@zeniai/client-epic-state 4.15.99 → 4.16.1

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.
@@ -4,6 +4,6 @@ import { AccountPayload } from '../../entity/account/accountPayload';
4
4
  import { ZeniReportResponse } from '../../responsePayload';
5
5
  export interface CashBalancePayload extends ReportPayload {
6
6
  accounts: AccountPayload[];
7
- balance: BalancePayload;
7
+ balance: BalancePayload | null;
8
8
  }
9
9
  export type CashBalanceResponse = ZeniReportResponse<CashBalancePayload>;
@@ -35,7 +35,7 @@ const cashBalance = (0, toolkit_1.createSlice)({
35
35
  const reportDataPayload = action.payload;
36
36
  draft.accountIDs = reportDataPayload.report.accounts.map((payload) => payload.account_id);
37
37
  draft.balance =
38
- reportDataPayload.report.balance != null
38
+ reportDataPayload.report.balance != null // Handle potential null balance from API (e.g., if no accounts exist)
39
39
  ? (0, balanceChangePayload_1.mapBalancePayloadToBalance)(reportDataPayload.report.balance)
40
40
  : undefined;
41
41
  const report = (0, viewAndReportPayload_1.mapReportPayloadToReport)(reportDataPayload.report);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.15.99",
3
+ "version": "4.16.1",
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",