@subwallet/extension-base 1.1.28-0 → 1.1.29-0

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.
@@ -705,9 +705,14 @@ class KoniState {
705
705
  }
706
706
  isFirstLoad = true;
707
707
  async handleResetBalance(newAddress, forceRefresh) {
708
- if (this.isFirstLoad || forceRefresh) {
708
+ if (this.isFirstLoad) {
709
709
  const backupBalanceData = await this.dbService.getStoredBalance();
710
710
  this.balanceMap.updateBalanceItems(backupBalanceData, (0, _utils2.isAccountAll)(newAddress));
711
+ this.isFirstLoad = false;
712
+ }
713
+ if (forceRefresh) {
714
+ this.balanceMap.setData({});
715
+ await this.dbService.stores.balance.clear();
711
716
  }
712
717
  await Promise.all([this.removeInactiveChainBalances()]);
713
718
  }
@@ -268,13 +268,13 @@ class KoniSubscription {
268
268
  async reloadBalance() {
269
269
  var _this$state$keyringSe3;
270
270
  const currentAddress = (_this$state$keyringSe3 = this.state.keyringService.currentAccount) === null || _this$state$keyringSe3 === void 0 ? void 0 : _this$state$keyringSe3.address;
271
+ await this.state.handleResetBalance(currentAddress, true);
271
272
  this.subscribeBalances(currentAddress, this.state.getChainInfoMap(), this.state.getChainStateMap(), this.state.getSubstrateApiMap(), this.state.getEvmApiMap());
272
273
  await (0, _utils2.waitTimeout)(1800);
273
274
  }
274
275
  async reloadCrowdloan() {
275
276
  var _this$state$keyringSe4;
276
277
  const currentAddress = (_this$state$keyringSe4 = this.state.keyringService.currentAccount) === null || _this$state$keyringSe4 === void 0 ? void 0 : _this$state$keyringSe4.address;
277
- await this.state.handleResetBalance(currentAddress, true);
278
278
  this.subscribeCrowdloans(currentAddress, this.state.getSubstrateApiMap());
279
279
  await (0, _utils2.waitTimeout)(1800);
280
280
  }
@@ -13,6 +13,6 @@ const packageInfo = {
13
13
  name: '@subwallet/extension-base',
14
14
  path: typeof __dirname === 'string' ? __dirname : 'auto',
15
15
  type: 'cjs',
16
- version: '1.1.28-0'
16
+ version: '1.1.29-0'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
@@ -691,9 +691,14 @@ export default class KoniState {
691
691
  }
692
692
  isFirstLoad = true;
693
693
  async handleResetBalance(newAddress, forceRefresh) {
694
- if (this.isFirstLoad || forceRefresh) {
694
+ if (this.isFirstLoad) {
695
695
  const backupBalanceData = await this.dbService.getStoredBalance();
696
696
  this.balanceMap.updateBalanceItems(backupBalanceData, isAccountAll(newAddress));
697
+ this.isFirstLoad = false;
698
+ }
699
+ if (forceRefresh) {
700
+ this.balanceMap.setData({});
701
+ await this.dbService.stores.balance.clear();
697
702
  }
698
703
  await Promise.all([this.removeInactiveChainBalances()]);
699
704
  }
@@ -255,13 +255,13 @@ export class KoniSubscription {
255
255
  async reloadBalance() {
256
256
  var _this$state$keyringSe3;
257
257
  const currentAddress = (_this$state$keyringSe3 = this.state.keyringService.currentAccount) === null || _this$state$keyringSe3 === void 0 ? void 0 : _this$state$keyringSe3.address;
258
+ await this.state.handleResetBalance(currentAddress, true);
258
259
  this.subscribeBalances(currentAddress, this.state.getChainInfoMap(), this.state.getChainStateMap(), this.state.getSubstrateApiMap(), this.state.getEvmApiMap());
259
260
  await waitTimeout(1800);
260
261
  }
261
262
  async reloadCrowdloan() {
262
263
  var _this$state$keyringSe4;
263
264
  const currentAddress = (_this$state$keyringSe4 = this.state.keyringService.currentAccount) === null || _this$state$keyringSe4 === void 0 ? void 0 : _this$state$keyringSe4.address;
264
- await this.state.handleResetBalance(currentAddress, true);
265
265
  this.subscribeCrowdloans(currentAddress, this.state.getSubstrateApiMap());
266
266
  await waitTimeout(1800);
267
267
  }
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "./cjs/detectPackage.js"
18
18
  ],
19
19
  "type": "module",
20
- "version": "1.1.28-0",
20
+ "version": "1.1.29-0",
21
21
  "main": "./cjs/index.js",
22
22
  "module": "./index.js",
23
23
  "types": "./index.d.ts",
@@ -1382,11 +1382,11 @@
1382
1382
  "@reduxjs/toolkit": "^1.9.1",
1383
1383
  "@sora-substrate/type-definitions": "^1.17.7",
1384
1384
  "@substrate/connect": "^0.7.26",
1385
- "@subwallet/chain-list": "0.2.31",
1386
- "@subwallet/extension-base": "^1.1.28-0",
1387
- "@subwallet/extension-chains": "^1.1.28-0",
1388
- "@subwallet/extension-dapp": "^1.1.28-0",
1389
- "@subwallet/extension-inject": "^1.1.28-0",
1385
+ "@subwallet/chain-list": "0.2.33",
1386
+ "@subwallet/extension-base": "^1.1.29-0",
1387
+ "@subwallet/extension-chains": "^1.1.29-0",
1388
+ "@subwallet/extension-dapp": "^1.1.29-0",
1389
+ "@subwallet/extension-inject": "^1.1.29-0",
1390
1390
  "@subwallet/keyring": "^0.1.1",
1391
1391
  "@subwallet/ui-keyring": "^0.1.1",
1392
1392
  "@walletconnect/sign-client": "^2.8.4",
package/packageInfo.js CHANGED
@@ -7,5 +7,5 @@ export const packageInfo = {
7
7
  name: '@subwallet/extension-base',
8
8
  path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
9
9
  type: 'esm',
10
- version: '1.1.28-0'
10
+ version: '1.1.29-0'
11
11
  };