From 0e0ec7a7c7429bce22b6d1eb26b86916537a4bc0 Mon Sep 17 00:00:00 2001 From: Proddy Date: Thu, 11 May 2023 21:37:24 +0200 Subject: [PATCH] improve layout --- interface/src/project/DashboardDevices.tsx | 4 +++- interface/src/project/DashboardDevicesDialog.tsx | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/interface/src/project/DashboardDevices.tsx b/interface/src/project/DashboardDevices.tsx index 064f8ed83..f7109a565 100644 --- a/interface/src/project/DashboardDevices.tsx +++ b/interface/src/project/DashboardDevices.tsx @@ -436,7 +436,9 @@ const DashboardDevices: FC = () => { } const sendCommand = (dv: DeviceValue) => { - setSelectedDeviceValueWriteable(dv.c && me.admin && !hasMask(dv.id, DeviceEntityMask.DV_READONLY)); + if (dv.c !== undefined) { + setSelectedDeviceValueWriteable(me.admin && !hasMask(dv.id, DeviceEntityMask.DV_READONLY)); + } setSelectedDeviceValue(dv); setDeviceValueDialogOpen(true); }; diff --git a/interface/src/project/DashboardDevicesDialog.tsx b/interface/src/project/DashboardDevicesDialog.tsx index b6abae4bb..ad5105c15 100644 --- a/interface/src/project/DashboardDevicesDialog.tsx +++ b/interface/src/project/DashboardDevicesDialog.tsx @@ -109,7 +109,15 @@ const DashboarDevicesDialog = ({ }; return ( - + {selectedItem.v === '' && selectedItem.c ? LL.RUN_COMMAND() : writeable ? LL.CHANGE_VALUE() : LL.VALUE(1)}