webapp: Fix error in device manager if no config was available

This commit is contained in:
Thomas Basler 2023-01-17 00:00:10 +01:00
parent 19b42223f5
commit 8377d5bb73

View File

@ -91,15 +91,17 @@ export default defineComponent({
.then( .then(
(data) => { (data) => {
this.pinMappingList = data; this.pinMappingList = data;
}
)
.catch(() => {
this.pinMappingList = Array<Device>();
})
.finally(() => {
this.pinMappingList.push({ this.pinMappingList.push({
"name": this.$t('deviceadmin.DefaultProfile') "name": this.$t('deviceadmin.DefaultProfile')
} as Device); } as Device);
this.pinMappingList.sort((a, b) => (a.name < b.name) ? -1 : 1); this.pinMappingList.sort((a, b) => (a.name < b.name) ? -1 : 1);
this.pinMappingLoading = false; this.pinMappingLoading = false;
}
)
.catch(() => {
this.pinMappingLoading = false;
}); });
}, },
getDeviceConfig() { getDeviceConfig() {