From af010e138d93fd023faf57ca18583f1050892d93 Mon Sep 17 00:00:00 2001 From: singh-kanwarpreet Date: Wed, 30 Jul 2025 00:01:27 +0530 Subject: [PATCH] Some changes in ui --- .../Settings/SettingsGlobalThresholds.jsx | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/client/src/Pages/Settings/SettingsGlobalThresholds.jsx b/client/src/Pages/Settings/SettingsGlobalThresholds.jsx index cd1c50927..96f14e62d 100644 --- a/client/src/Pages/Settings/SettingsGlobalThresholds.jsx +++ b/client/src/Pages/Settings/SettingsGlobalThresholds.jsx @@ -26,17 +26,16 @@ const SettingsGlobalThresholds = ({ temperature: "", }); - // Load existing thresholds from settingsData on first render or when settingsData changes - useEffect(() => { - if (settingsData?.settings?.globalThresholds) { - setThresholds({ - cpu: settingsData.settings.globalThresholds.cpu || "", - memory: settingsData.settings.globalThresholds.memory || "", - disk: settingsData.settings.globalThresholds.disk || "", - temperature: settingsData.settings.globalThresholds.temperature || "", - }); - } - }, [settingsData]); + // Load existing thresholds from settingsData + + if (settingsData?.settings?.globalThresholds) { + setThresholds({ + cpu: settingsData.settings.globalThresholds.cpu || "", + memory: settingsData.settings.globalThresholds.memory || "", + disk: settingsData.settings.globalThresholds.disk || "", + temperature: settingsData.settings.globalThresholds.temperature || "", + }); + } // Handles input change and updates state & parent data const handleChange = (e, min, max) => {