set account ui state on createElement. fixes #1325

This commit is contained in:
Danny Coates 2019-05-28 14:54:58 -07:00
parent 72497b77b2
commit 73735010ae
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB

View File

@ -9,7 +9,7 @@ class Account extends Component {
this.enabled = state.capabilities.account;
this.local = state.components[name] = {};
this.buttonClass = '';
this.setState();
this.setLocal();
}
avatarClick(event) {
@ -39,7 +39,7 @@ class Account extends Component {
return this.local.loggedIn !== this.state.user.loggedIn;
}
setState() {
setLocal() {
const changed = this.changed();
if (changed) {
this.local.loggedIn = this.state.user.loggedIn;
@ -48,7 +48,7 @@ class Account extends Component {
}
update() {
return this.setState();
return this.setLocal();
}
createElement() {
@ -59,6 +59,7 @@ class Account extends Component {
}
const user = this.state.user;
const translate = this.state.translate;
this.setLocal();
if (!this.local.loggedIn) {
return html`
<send-account>