mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
fix refresh sensorData
This commit is contained in:
@@ -103,7 +103,7 @@ const DashboardData: FC = () => {
|
|||||||
}
|
}
|
||||||
loadData();
|
loadData();
|
||||||
|
|
||||||
if (selectedDevice === 0) {
|
if (sensorData) {
|
||||||
fetchSensorData();
|
fetchSensorData();
|
||||||
} else if (selectedDevice) {
|
} else if (selectedDevice) {
|
||||||
fetchDeviceData(selectedDevice);
|
fetchDeviceData(selectedDevice);
|
||||||
@@ -116,7 +116,7 @@ const DashboardData: FC = () => {
|
|||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
};
|
};
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
}, [analog, sensor, deviceValue, selectedDevice]);
|
}, [analog, sensor, deviceValue, sensorData, selectedDevice]);
|
||||||
|
|
||||||
const fetchDeviceData = async (unique_id: number) => {
|
const fetchDeviceData = async (unique_id: number) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user