Pushed global thresholds inside create if branch

This commit is contained in:
singh-kanwarpreet committed 2025-07-30 19:38:23 +05:30
1 parent 0ecbf48f5d
commit 5e46a9f2d5
1 file changed
+4 -4
@@ -93,6 +93,10 @@ const CreateInfrastructureMonitor = () => {
// Populate form fields if editing
useEffect(() => {
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: "",
@@ -101,10 +105,6 @@ const CreateInfrastructureMonitor = () => {
temperature: "",
};
if (isCreate) {
// If global settings are not loaded yet, use default thresholds
if (globalSettingsLoading) return;
// Create mode: use global thresholds
setInfrastructureMonitor((prev) => ({
...prev,
url: "",