-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Close on double-click for Signer Account selection #4540
Conversation
this.defaultAccount = defaultAccount; | ||
transaction(() => { | ||
this.accounts = this.accounts.map((account) => { | ||
account.default = account.address === this.defaultAccount; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? It basically sets the default to the previous default, i.e. this.defaultAccount is previous version since default is only set afterwards. Looks wrong. (If correct, a NOTE explanation may be in order here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes right...
return this._api.parity | ||
.setNewDappsWhitelist(accounts) | ||
.catch((error) => { | ||
console.warn('makeDefaultAccount', error); | ||
}); | ||
} | ||
|
||
loadDefaultAccount () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would probably make sense to add this to the spec.js as well (since the store is more-or-less tested already)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
Closes #4525
Close only on double-click. Change default on simple click.
Also update the default in an optimistic way (not waiting for network request). The request will be valid 99% of the time. If not, it will just be reverted.