mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
fix refresh sensorData
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user