@mx-cartographer/experiences 3.1.0-alpha.sms5-await3 → 3.1.0-alpha.sms5-await5

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ export declare class AccountStore {
11
11
  members: Member[];
12
12
  uiStore: UiStore;
13
13
  constructor(globalStore: GlobalStore);
14
- initialize: (endpoint: string, token: string) => void;
14
+ initialize: (endpoint: string, token: string) => Promise<void>;
15
15
  get cashAccounts(): Account[];
16
16
  get cashBalance(): number;
17
17
  addAccount: (account: Account) => Promise<void>;
@@ -26,7 +26,7 @@ export declare class AccountStore {
26
26
  }) => Promise<any>;
27
27
  mergeAccounts: (accountGuids: string[]) => Promise<void>;
28
28
  sortAccounts: (accounts?: Account[]) => void;
29
- refreshAccounts: () => void;
29
+ refreshAccounts: () => Promise<void>;
30
30
  refreshMembers: () => Promise<void>;
31
31
  removeAccount: (accountGuid: string) => Promise<void>;
32
32
  updateAccount: (account: Account) => Promise<void>;
package/dist/index.es.js CHANGED
@@ -3643,14 +3643,7 @@ class Dc {
3643
3643
  this.globalStore = e, this.uiStore = new Ic(), yA(this);
3644
3644
  }
3645
3645
  initialize = async (e, n) => {
3646
- this.api = new Na(e, n), this.beatApi = new Ge(e, n), Promise.all([
3647
- this.loadAssociatedBeats(vA(/* @__PURE__ */ new Date())),
3648
- this.loadTags(),
3649
- this.loadTaggings(),
3650
- this.loadTransactionRules(),
3651
- // By default loads 90 days of transactions
3652
- this.loadTransactions()
3653
- ]).then(() => this.uiStore.setIsInitialized(!0));
3646
+ this.api = new Na(e, n), this.beatApi = new Ge(e, n), await this.loadAssociatedBeats(vA(/* @__PURE__ */ new Date())), await this.loadTags(), await this.loadTaggings(), await this.loadTransactionRules(), await this.loadTransactions(), this.uiStore.setIsInitialized(!0);
3654
3647
  };
3655
3648
  get sortedTransactions() {
3656
3649
  return yc(
@@ -8927,7 +8920,7 @@ class O7 {
8927
8920
  const a = Date.now();
8928
8921
  console.log("start awaits", a), await this.copyStore.initialize(e, n), await this.accountStore.initialize(e, n), await this.beatStore.initialize(e, n), await this.merchantStore.initialize(e, n), await this.userStore.initialize(e, n), await this.categoryStore.initialize(e, n), await this.transactionStore.initialize(e, n), await this.recurringActivityStore.initialize(e, n), await this.budgetsStore.initialize(e, n), await this.notificationStore.initialize(e, n), F(() => {
8929
8922
  const r = Date.now();
8930
- console.log("finish awaits", r), this.isInitialized = !0, this.globalUiStore.setInitialized(!0), this.globalUiStore.setSelectedAccounts(this.accountStore.accounts);
8923
+ console.log("finish awaits", r), console.log(`Total time: ${r - a}`), this.isInitialized = !0, this.globalUiStore.setInitialized(!0), this.globalUiStore.setSelectedAccounts(this.accountStore.accounts);
8931
8924
  });
8932
8925
  };
8933
8926
  }
@@ -10459,11 +10452,8 @@ class Yu {
10459
10452
  constructor(e) {
10460
10453
  this.globalStore = e, this.uiStore = new Wu(), yA(this);
10461
10454
  }
10462
- initialize = (e, n) => {
10463
- this.api = new ar(e, n), this.widgetApi = new Ta(e, n), Promise.all([
10464
- this.loadAccounts(),
10465
- this.loadInstitutions()
10466
- ]);
10455
+ initialize = async (e, n) => {
10456
+ this.api = new ar(e, n), this.widgetApi = new Ta(e, n), await this.loadAccounts(), await this.loadInstitutions();
10467
10457
  };
10468
10458
  get cashAccounts() {
10469
10459
  return this.accounts.filter(
@@ -10546,11 +10536,8 @@ class Yu {
10546
10536
  sortAccounts = (e = this.accounts) => {
10547
10537
  this.accounts = e.sort((n, a) => n.account_type > a.account_type ? 1 : n.account_type < a.account_type ? -1 : (n.name || "") > (a.name || "") ? 1 : (n.name || "") < (a.name || "") ? -1 : 0);
10548
10538
  };
10549
- refreshAccounts = () => {
10550
- this.uiStore.setIsLoading(!0), Promise.all([
10551
- this.loadAccounts(),
10552
- this.loadInstitutions()
10553
- ]), this.uiStore.setIsLoading(!1);
10539
+ refreshAccounts = async () => {
10540
+ this.uiStore.setIsLoading(!0), await this.loadAccounts(), await this.loadInstitutions(), this.uiStore.setIsLoading(!1);
10554
10541
  };
10555
10542
  refreshMembers = async () => {
10556
10543
  try {