From 5e46a9f2d51e4b93bf0e56b1dee5cceb72df3752 Mon Sep 17 00:00:00 2001 From: singh-kanwarpreet Date: Wed, 30 Jul 2025 19:38:23 +0530 Subject: [PATCH] Pushed global thresholds inside create if branch --- client/src/Pages/Infrastructure/Create/index.jsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/src/Pages/Infrastructure/Create/index.jsx b/client/src/Pages/Infrastructure/Create/index.jsx index be9cb6062..73a11c40f 100644 --- a/client/src/Pages/Infrastructure/Create/index.jsx +++ b/client/src/Pages/Infrastructure/Create/index.jsx @@ -93,18 +93,18 @@ const CreateInfrastructureMonitor = () => { // Populate form fields if editing useEffect(() => { - const globalThresholds = globalSettings?.data?.settings?.globalThresholds; - const defaultThresholds = { - cpu: "", - memory: "", - disk: "", - temperature: "", - }; - if (isCreate) { // If global settings are not loaded yet, use default thresholds if (globalSettingsLoading) return; // Create mode: use global thresholds + const globalThresholds = globalSettings?.data?.settings?.globalThresholds; + const defaultThresholds = { + cpu: "", + memory: "", + disk: "", + temperature: "", + }; + setInfrastructureMonitor((prev) => ({ ...prev, url: "",