receive page: auto-select account if it is the only account in the wallet

This commit is contained in:
keeri 2023-05-23 13:35:14 +00:00
commit e6dda6a930

View file

@ -112,10 +112,14 @@ export class ReceiveComponent implements OnInit, OnDestroy {
await this.updatePendingBlocks();
// Set the account selected in the sidebar as default
if (this.walletService.wallet.selectedAccount !== null) {
// Set the account selected in the sidebar as default
this.pendingAccountModel = this.walletService.wallet.selectedAccount.id;
this.onSelectedAccountChange(this.pendingAccountModel);
} else if (this.accounts.length === 1) {
// Auto-select account if it is the only account in the wallet
this.pendingAccountModel = this.accounts[0].id;
this.onSelectedAccountChange(this.pendingAccountModel);
}
// Listen as new transactions come in. Ignore the latest transaction that is already present on page load.