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');
if (!lodash.isEmpty(this.libraryName.value)) {
const originalConfig = lodash.clone(this.config); const originalConfig = lodash.clone(this.config);
this.config.protocol = this.protocol.value;
this.config.ip = this.ip.value; this.config.ip = this.ip.value;
this.config.token = this.token.value; this.config.token = this.token.value;
this.config.port = this.port.value; this.config.port = this.port.value;
if (!lodash.isEmpty(this.libraryName.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,12 +19497,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
} }
}); });
} }
}
if (!lodash.isEqual(this.config, originalConfig)) { if (!lodash.isEqual(this.config, originalConfig)) {
console.log(this.config); console.log(this.config);
console.log(originalConfig); console.log(originalConfig);
this.fireEvent(this, 'config-changed', { config: this.config }); this.fireEvent(this, 'config-changed', { config: this.config });
} }
}
}; };
this.render = async () => { this.render = async () => {
const addDropdownItem = (text) => { const addDropdownItem = (text) => {

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

Loading…
Cancel
Save