mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2025-12-12 01:40:52 +01:00
webapp: Doublecheck for undefined behavior
This commit is contained in:
@@ -315,7 +315,7 @@ export default defineComponent({
|
|||||||
if (!val) {
|
if (!val) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.deviceConfigList.led.every((v) => (v.brightness = this.deviceConfigList.led[0].brightness));
|
this.deviceConfigList.led.every((v) => (v.brightness = this.deviceConfigList.led[0]?.brightness ?? 0));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -397,7 +397,7 @@ export default defineComponent({
|
|||||||
return parseInt(id.replace('inputLED', '').replace('Brightness', ''));
|
return parseInt(id.replace('inputLED', '').replace('Brightness', ''));
|
||||||
},
|
},
|
||||||
isEqualBrightness(): boolean {
|
isEqualBrightness(): boolean {
|
||||||
const allEqual = (arr: Led[]) => arr.every((v) => v.brightness === arr[0].brightness);
|
const allEqual = (arr: Led[]) => arr.every((v) => v.brightness === arr[0]?.brightness);
|
||||||
return allEqual(this.deviceConfigList.led);
|
return allEqual(this.deviceConfigList.led);
|
||||||
},
|
},
|
||||||
syncSliders(event: Event) {
|
syncSliders(event: Event) {
|
||||||
@@ -405,7 +405,7 @@ export default defineComponent({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const srcId = this.getNumberFromLedId((event.target as Element).id);
|
const srcId = this.getNumberFromLedId((event.target as Element).id);
|
||||||
this.deviceConfigList.led.map((v) => (v.brightness = this.deviceConfigList.led[srcId].brightness));
|
this.deviceConfigList.led.map((v) => (v.brightness = this.deviceConfigList.led[srcId]?.brightness ?? 0));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user