2.0
Juraj Nyíri 3 years ago
parent e5d16ab46c
commit dafd64afe2

@ -19475,13 +19475,13 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
}; };
this.valueUpdated = () => { this.valueUpdated = () => {
console.log('valueUpdated'); console.log('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 (!lodash.isEmpty(this.libraryName.value)) { if (!lodash.isEmpty(this.libraryName.value)) {
const originalConfig = lodash.clone(this.config);
this.config.ip = this.ip.value;
this.config.token = this.token.value;
this.config.port = this.port.value;
this.config.libraryName = this.libraryName.value; this.config.libraryName = this.libraryName.value;
this.config.protocol = this.protocol.value;
this.config.sort = `${this.sort.value}:${this.sortOrder.value}`; this.config.sort = `${this.sort.value}:${this.sortOrder.value}`;
if (lodash.isEmpty(this.maxCount.value)) { if (lodash.isEmpty(this.maxCount.value)) {
this.config.maxCount = ''; this.config.maxCount = '';
@ -19497,11 +19497,11 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
} }
}); });
} }
if (!lodash.isEqual(this.config, originalConfig)) { }
console.log(this.config); if (!lodash.isEqual(this.config, originalConfig)) {
console.log(originalConfig); console.log(this.config);
this.fireEvent(this, 'config-changed', { config: this.config }); console.log(originalConfig);
} this.fireEvent(this, 'config-changed', { config: this.config });
} }
}; };
this.render = async () => { this.render = async () => {

@ -66,14 +66,14 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
valueUpdated = (): void => { valueUpdated = (): void => {
console.log('valueUpdated'); console.log('valueUpdated');
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 (!_.isEmpty(this.libraryName.value)) { if (!_.isEmpty(this.libraryName.value)) {
const originalConfig = _.clone(this.config);
this.config.ip = this.ip.value;
this.config.token = this.token.value;
this.config.port = this.port.value;
this.config.libraryName = this.libraryName.value; this.config.libraryName = this.libraryName.value;
this.config.protocol = this.protocol.value;
this.config.sort = `${this.sort.value}:${this.sortOrder.value}`; this.config.sort = `${this.sort.value}:${this.sortOrder.value}`;
if (_.isEmpty(this.maxCount.value)) { if (_.isEmpty(this.maxCount.value)) {
this.config.maxCount = ''; this.config.maxCount = '';
@ -89,11 +89,11 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
} }
}); });
} }
if (!_.isEqual(this.config, originalConfig)) { }
console.log(this.config); if (!_.isEqual(this.config, originalConfig)) {
console.log(originalConfig); console.log(this.config);
this.fireEvent(this, 'config-changed', { config: this.config }); console.log(originalConfig);
} this.fireEvent(this, 'config-changed', { config: this.config });
} }
}; };

Loading…
Cancel
Save