Skip to content

Commit

Permalink
Add an unselected account list get function
Browse files Browse the repository at this point in the history
  • Loading branch information
Kang-Simon authored and TrustHenry committed Dec 24, 2021
1 parent 0ab7b7b commit 3af7f65
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/modules/wallet/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,20 @@ export class AccountContainer extends EventDispatcher {
return this._items[this._selected_index];
}

/**
* The getter of un_selected_accounts
*/
public get un_select_accounts(): Account[] | null {
if (this._selected_index < 0) return null;
if (this._items.length <= 1) return null;
const selAccount = this.selected_account;
if (selAccount){
return this._items.filter((m) => !PublicKey.equal(m.address, selAccount.address));
} else {
return null;
}
}

/**
* Add one account.
* @param name The name of the account
Expand Down

0 comments on commit 3af7f65

Please sign in to comment.