From 55672cc9dea637b6879b86a1f5187011811a558f Mon Sep 17 00:00:00 2001 From: Proddy Date: Sat, 10 Feb 2024 15:43:03 +0100 Subject: [PATCH] don't show bus scanning, so orange warning doesn't render on refresh --- interface/src/project/DashboardDevices.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/interface/src/project/DashboardDevices.tsx b/interface/src/project/DashboardDevices.tsx index f59047e3f..d95bc9f3a 100644 --- a/interface/src/project/DashboardDevices.tsx +++ b/interface/src/project/DashboardDevices.tsx @@ -94,8 +94,14 @@ const DashboardDevices: FC = () => { }, []); const leftOffset = () => { - const left = document.getElementById('devices-window')?.getBoundingClientRect().left; - const right = document.getElementById('devices-window')?.getBoundingClientRect().right; + const devicesWindow = document.getElementById('devices-window'); + if (!devicesWindow) { + return 0; + } + + const clientRect = devicesWindow.getBoundingClientRect(); + const left = clientRect.left; + const right = clientRect.right; if (!left || !right) { return 0; @@ -416,11 +422,11 @@ const DashboardDevices: FC = () => { const renderCoreData = () => ( {!coreData.connected && } - {coreData.connected && coreData.devices.length === 0 && ( + {/* {coreData.connected && coreData.devices.length === 0 && ( - )} + )} */} - {coreData.devices.length !== 0 && ( + {coreData.connected && ( {(tableList: any) => ( <>