Pushed global thresholds inside create if branch

This commit is contained in:
singh-kanwarpreet
2025-07-30 19:38:23 +05:30
parent 0ecbf48f5d
commit 5e46a9f2d5

View File

@@ -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: "",