diff --git a/src/textswitch.js b/src/textswitch.js index 3066a12940238465b0e9bcdc080494e33fc067c5..4e03c27a835b01c4555b83c1bc8f00d78e922fec 100644 --- a/src/textswitch.js +++ b/src/textswitch.js @@ -63,11 +63,7 @@ export class TextSwitch extends LitElement { } update(changedProperties) { - if (this._active === BUTTON1) { - this.name = this.name1; - } else { - this.name = this.name2; - } + this.name = this._active === BUTTON1 ? this.name1 : this.name2; changedProperties.forEach((oldValue, propName) => { if (propName === "name") {