diff --git a/src/components/MarketPlace/PopUp/MarketPopUp.jsx b/src/components/MarketPlace/PopUp/MarketPopUp.jsx index 38ba43d..1f3bc7b 100644 --- a/src/components/MarketPlace/PopUp/MarketPopUp.jsx +++ b/src/components/MarketPlace/PopUp/MarketPopUp.jsx @@ -7,6 +7,10 @@ import LoadingSpinner from "../../Spinners/LoadingSpinner"; const MarketPopUp = ({ details, onClose, situation, marketInt }) => { const [textValue, setTextValue] = useState(""); + const [errMsg, setErrMsg] = useState({ + market: false, + manage: false, + }); const apiCall = useMemo(() => new usersService(), []); const handleInputChange = ({ target: { value } }) => { @@ -50,11 +54,14 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => { setMarketMsg({ data: marketMessageRes, state: true }); } catch (error) { + setErrMsg({ market: true }); + setMarketMsg({ loading: false, state: false }); throw new Error(error); } finally { + setTextValue(""); setTimeout(() => { - setTextValue(""); setMarketMsg({ loading: false, state: false }); + setErrMsg({ market: false }); }, 5000); } }; @@ -195,17 +202,20 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => { If you have any questions about this task: -