@pisell/pisellos 0.0.169 → 0.0.170

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.
@@ -326,7 +326,7 @@ export var AccountListModule = /*#__PURE__*/function (_BaseModule) {
326
326
  });
327
327
 
328
328
  // 检测 如果被删除的是活跃账号,则默认把第一个账号设置为 activeAccount
329
- if (((_this$getActiveAccoun = this.getActiveAccount()) === null || _this$getActiveAccoun === void 0 ? void 0 : _this$getActiveAccoun.getId()) === id) {
329
+ if (!this.getActiveAccount() || ((_this$getActiveAccoun = this.getActiveAccount()) === null || _this$getActiveAccoun === void 0 ? void 0 : _this$getActiveAccoun.getId()) === id || this.store.accounts.length === 1) {
330
330
  this.setActiveAccount(this.store.accounts[0].getId());
331
331
  }
332
332
  _context6.next = 12;
@@ -195,7 +195,7 @@ var AccountListModule = class extends import_BaseModule.BaseModule {
195
195
  this.store.accountList = this.store.accountList.filter(
196
196
  (account) => account.id !== id
197
197
  );
198
- if (((_a = this.getActiveAccount()) == null ? void 0 : _a.getId()) === id) {
198
+ if (!this.getActiveAccount() || ((_a = this.getActiveAccount()) == null ? void 0 : _a.getId()) === id || this.store.accounts.length === 1) {
199
199
  this.setActiveAccount(this.store.accounts[0].getId());
200
200
  }
201
201
  await this.core.effects.emit(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.169",
4
+ "version": "0.0.170",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",