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