From e52753e83c9c772f12f79d28f3764e1b351a42ae Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 10 Oct 2024 21:25:11 +0100 Subject: [PATCH] rename DialogProps --- interface/src/app/main/DevicesDialog.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/interface/src/app/main/DevicesDialog.tsx b/interface/src/app/main/DevicesDialog.tsx index 98127c1ec..7e0389426 100644 --- a/interface/src/app/main/DevicesDialog.tsx +++ b/interface/src/app/main/DevicesDialog.tsx @@ -29,7 +29,7 @@ import { validate } from 'validators'; import { DeviceValueUOM, DeviceValueUOM_s } from './types'; import type { DeviceValue } from './types'; -interface DashboardDevicesDialogProps { +interface DevicesDialogProps { open: boolean; onClose: () => void; onSave: (as: DeviceValue) => void; @@ -47,7 +47,7 @@ const DevicesDialog = ({ writeable, validator, progress -}: DashboardDevicesDialogProps) => { +}: DevicesDialogProps) => { const { LL } = useI18nContext(); const [editItem, setEditItem] = useState(selectedItem); const [fieldErrors, setFieldErrors] = useState(); @@ -75,7 +75,10 @@ const DevicesDialog = ({ } }; - const setUom = (uom: DeviceValueUOM) => { + const setUom = (uom?: DeviceValueUOM) => { + if (uom === undefined) { + return; + } switch (uom) { case DeviceValueUOM.HOURS: return LL.HOURS();