diff --git a/app/src/Model2.js b/app/src/Model2.js index b7c3bef..f25aa92 100644 --- a/app/src/Model2.js +++ b/app/src/Model2.js @@ -6,6 +6,7 @@ function Model2() { const [values, setValues] = useState([""]); const [response, setResponse] = useState([""]); + const [flag, setFlag] = useState(false); const [selectedOption1, setSelectedOption1] = useState([""]); const [selectedOption2, setSelectedOption2] = useState([""]); const [selectedOption3, setSelectedOption3] = useState([""]); @@ -74,6 +75,7 @@ function Model2() { const handleSubmit = async(e) => { e.preventDefault(); + setFlag(true); setValues(values); try { const response = await fetch('https://fluence-backend.onrender.com/api/process_input_seasonal', { @@ -103,6 +105,7 @@ function Model2() { else { setResponse("Some error occured"); } + setFlag(false); } catch (error) { console.error("Error: ", error); @@ -249,7 +252,9 @@ function Model2() { - {response &&