Merge pull request #590 from keerifox/receive-page-autoselect-only-acc

Auto-select account on Receive page if it is the only account in the wallet
This commit is contained in:
Joohansson (Json) 2023-08-14 13:12:49 +02:00 committed by GitHub
commit c1e8709715
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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.