From 38587e966b2eea30ae16e5ea10137b0b093c9026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Mon, 12 Jul 2021 23:13:29 +0200 Subject: [PATCH] Fix: Critical bug where setting up card was not possible via UI --- dist/plex-meets-homeassistant.js | 16 ++++++++-------- src/editor.ts | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index c2c1373..31b7fda 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -19489,12 +19489,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { return event; }; this.valueUpdated = () => { + const originalConfig = lodash.clone(this.config); + this.config.protocol = this.protocol.value; + this.config.ip = this.ip.value; + this.config.token = this.token.value; + this.config.port = this.port.value; if (this.loaded) { - const originalConfig = lodash.clone(this.config); - this.config.protocol = this.protocol.value; - this.config.ip = this.ip.value; - this.config.token = this.token.value; - this.config.port = this.port.value; if (!this.config.entity) { this.config.entity = []; } @@ -19551,9 +19551,9 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { this.config.runBefore = this.runBefore.value; this.config.runAfter = this.runAfter.value; } - if (!lodash.isEqual(this.config, originalConfig)) { - this.fireEvent(this, 'config-changed', { config: this.config }); - } + } + if (!lodash.isEqual(this.config, originalConfig)) { + this.fireEvent(this, 'config-changed', { config: this.config }); } }; this.render = async () => { diff --git a/src/editor.ts b/src/editor.ts index 11a97f6..38fe154 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -83,12 +83,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { }; valueUpdated = (): void => { + const originalConfig = _.clone(this.config); + this.config.protocol = this.protocol.value; + this.config.ip = this.ip.value; + this.config.token = this.token.value; + this.config.port = this.port.value; if (this.loaded) { - const originalConfig = _.clone(this.config); - this.config.protocol = this.protocol.value; - this.config.ip = this.ip.value; - this.config.token = this.token.value; - this.config.port = this.port.value; if (!this.config.entity) { this.config.entity = []; } @@ -141,9 +141,9 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { this.config.runBefore = this.runBefore.value; this.config.runAfter = this.runAfter.value; } - if (!_.isEqual(this.config, originalConfig)) { - this.fireEvent(this, 'config-changed', { config: this.config }); - } + } + if (!_.isEqual(this.config, originalConfig)) { + this.fireEvent(this, 'config-changed', { config: this.config }); } };