diff --git a/interface/src/project/DashboardData.tsx b/interface/src/project/DashboardData.tsx index 50a8726dd..a94b69aac 100644 --- a/interface/src/project/DashboardData.tsx +++ b/interface/src/project/DashboardData.tsx @@ -103,7 +103,7 @@ const DashboardData: FC = () => { } loadData(); - if (selectedDevice === 0) { + if (sensorData) { fetchSensorData(); } else if (selectedDevice) { fetchDeviceData(selectedDevice); @@ -116,7 +116,7 @@ const DashboardData: FC = () => { clearInterval(timer); }; // eslint-disable-next-line - }, [analog, sensor, deviceValue, selectedDevice]); + }, [analog, sensor, deviceValue, sensorData, selectedDevice]); const fetchDeviceData = async (unique_id: number) => { try {