diff --git a/src/pages/Admin/Group/Create/index.jsx b/src/pages/Admin/Group/Create/index.jsx index 82f4cd9f4..b9821364a 100644 --- a/src/pages/Admin/Group/Create/index.jsx +++ b/src/pages/Admin/Group/Create/index.jsx @@ -63,6 +63,7 @@ const GroupCreate = () => { .finally(() => { setLoading(false); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }; return ( diff --git a/src/pages/Admin/Users/Delete/index.jsx b/src/pages/Admin/Users/Delete/index.jsx index b5de99e11..fd701a7bf 100644 --- a/src/pages/Admin/Users/Delete/index.jsx +++ b/src/pages/Admin/Users/Delete/index.jsx @@ -91,6 +91,7 @@ const DeleteUser = () => { .finally(() => { setLoading(false); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); } else { setMessage({ @@ -98,6 +99,7 @@ const DeleteUser = () => { text: "Deletion not confirmed", }); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); } }; @@ -109,6 +111,7 @@ const DeleteUser = () => { .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }, []); return ( diff --git a/src/pages/Browse/index.jsx b/src/pages/Browse/index.jsx index a7fb4e63c..ce0a2f7d4 100644 --- a/src/pages/Browse/index.jsx +++ b/src/pages/Browse/index.jsx @@ -133,6 +133,7 @@ const Browse = () => { text: "Error occured in fetching", }); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }, [browseData]); @@ -162,6 +163,7 @@ const Browse = () => { text: "Error occured in fetching folder list", }); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }, []); diff --git a/src/pages/Home/index.jsx b/src/pages/Home/index.jsx index e1904c101..de490913c 100644 --- a/src/pages/Home/index.jsx +++ b/src/pages/Home/index.jsx @@ -79,6 +79,7 @@ const Home = ({ location }) => { setLoading(false); setErrorMessage(err.message); setShowError(true); + setTimeout(() => setShowError(false), 2000); }); }; @@ -88,6 +89,7 @@ const Home = ({ location }) => { if (message) { setErrorMessage(message); setShowError(true); + setTimeout(() => setShowError(false), 2000); } window.history.replaceState(null, null, window.location.pathname); }, [location.search]); diff --git a/src/pages/Jobs/ScheduleAgents/index.jsx b/src/pages/Jobs/ScheduleAgents/index.jsx index 65479da02..323e80bbc 100644 --- a/src/pages/Jobs/ScheduleAgents/index.jsx +++ b/src/pages/Jobs/ScheduleAgents/index.jsx @@ -122,6 +122,7 @@ const ScheduleAgents = () => { .finally(() => { setLoading(false); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }; const handleChange = (e) => { diff --git a/src/pages/Organize/Folder/Create/index.jsx b/src/pages/Organize/Folder/Create/index.jsx index 481ac174b..f61ec1d1e 100644 --- a/src/pages/Organize/Folder/Create/index.jsx +++ b/src/pages/Organize/Folder/Create/index.jsx @@ -85,6 +85,7 @@ const CreateFolder = () => { .finally(() => { setLoading(false); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }; @@ -96,6 +97,7 @@ const CreateFolder = () => { .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }, []); diff --git a/src/pages/Organize/Folder/Delete/index.jsx b/src/pages/Organize/Folder/Delete/index.jsx index 646035fdd..ad4fafc5a 100644 --- a/src/pages/Organize/Folder/Delete/index.jsx +++ b/src/pages/Organize/Folder/Delete/index.jsx @@ -88,6 +88,7 @@ const DeleteFolder = () => { .finally(() => { setLoading(false); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }; @@ -99,6 +100,7 @@ const DeleteFolder = () => { .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }, []); return ( diff --git a/src/pages/Organize/Folder/Edit/index.jsx b/src/pages/Organize/Folder/Edit/index.jsx index 92b2645a3..383ba56b3 100644 --- a/src/pages/Organize/Folder/Edit/index.jsx +++ b/src/pages/Organize/Folder/Edit/index.jsx @@ -85,6 +85,7 @@ const EditFolder = () => { .finally(() => { setLoading(false); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }; @@ -96,6 +97,7 @@ const EditFolder = () => { .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }, []); @@ -107,6 +109,7 @@ const EditFolder = () => { .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }, [id]); diff --git a/src/pages/Organize/Folder/Move/index.jsx b/src/pages/Organize/Folder/Move/index.jsx index 0e5deefdf..39b1872fd 100644 --- a/src/pages/Organize/Folder/Move/index.jsx +++ b/src/pages/Organize/Folder/Move/index.jsx @@ -80,6 +80,7 @@ const MoveFolder = () => { }) .finally(() => { setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }; @@ -97,6 +98,7 @@ const MoveFolder = () => { }) .finally(() => { setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }; @@ -108,6 +110,7 @@ const MoveFolder = () => { .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }, []); diff --git a/src/pages/Organize/Folder/Unlink/index.jsx b/src/pages/Organize/Folder/Unlink/index.jsx index b3e8c2d2d..ee6db51df 100644 --- a/src/pages/Organize/Folder/Unlink/index.jsx +++ b/src/pages/Organize/Folder/Unlink/index.jsx @@ -89,6 +89,7 @@ const UnlinkFolder = () => { .finally(() => { setLoading(false); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }; @@ -100,6 +101,7 @@ const UnlinkFolder = () => { .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }, []); return ( diff --git a/src/pages/Organize/License/CandidateLicense/index.jsx b/src/pages/Organize/License/CandidateLicense/index.jsx index 6af168642..48c515e91 100644 --- a/src/pages/Organize/License/CandidateLicense/index.jsx +++ b/src/pages/Organize/License/CandidateLicense/index.jsx @@ -89,6 +89,7 @@ const AdviceLicenses = () => { text: error.message, }); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }, [licenseData]); return ( diff --git a/src/pages/Organize/License/Create/index.jsx b/src/pages/Organize/License/Create/index.jsx index e5faa4a9d..0a2caac97 100644 --- a/src/pages/Organize/License/Create/index.jsx +++ b/src/pages/Organize/License/Create/index.jsx @@ -103,6 +103,7 @@ const AddCandidateLicense = () => { .finally(() => { setLoading(false); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }; return ( diff --git a/src/pages/Organize/Uploads/Delete/index.jsx b/src/pages/Organize/Uploads/Delete/index.jsx index 7b7c44a1a..d2ca5918f 100644 --- a/src/pages/Organize/Uploads/Delete/index.jsx +++ b/src/pages/Organize/Uploads/Delete/index.jsx @@ -104,6 +104,7 @@ const UploadDelete = () => { .finally(() => { setLoading(false); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }); } else { @@ -113,6 +114,7 @@ const UploadDelete = () => { type: "danger", text: "Select the uploads to delete", }); + setTimeout(() => setShowMessage(false), 2000); } }; diff --git a/src/pages/Organize/Uploads/Edit/index.jsx b/src/pages/Organize/Uploads/Edit/index.jsx index aa81bd59a..d4d9849e9 100644 --- a/src/pages/Organize/Uploads/Edit/index.jsx +++ b/src/pages/Organize/Uploads/Edit/index.jsx @@ -85,6 +85,7 @@ const UploadEdit = () => { .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); getUploadsFolderId(editUploadFolderData.folderId) .then((res) => { @@ -93,6 +94,7 @@ const UploadEdit = () => { .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); if (editUploadFolderData.uploadId) { getUploadById(editUploadFolderData.uploadId) @@ -106,6 +108,7 @@ const UploadEdit = () => { .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); } }, [editUploadFolderData.folderId, editUploadFolderData.uploadId]); diff --git a/src/pages/Organize/Uploads/Move/index.jsx b/src/pages/Organize/Uploads/Move/index.jsx index b6816a58e..5c4f0f539 100644 --- a/src/pages/Organize/Uploads/Move/index.jsx +++ b/src/pages/Organize/Uploads/Move/index.jsx @@ -89,6 +89,7 @@ const UploadMove = () => { .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }; @@ -104,10 +105,12 @@ const UploadMove = () => { }); getUploadList(); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }) .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }); } else { @@ -117,6 +120,7 @@ const UploadMove = () => { type: "danger", text: "Select the uploads to move", }); + setTimeout(() => setShowMessage(false), 2000); } }; @@ -132,10 +136,12 @@ const UploadMove = () => { }); getUploadList(); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }) .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }); } else { @@ -145,6 +151,7 @@ const UploadMove = () => { type: "danger", text: "Select the uploads to copy", }); + setTimeout(() => setShowMessage(false), 2000); } }; useEffect(() => { @@ -155,6 +162,7 @@ const UploadMove = () => { .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); getUploadList(); }, [folderId]); diff --git a/src/pages/Search/index.jsx b/src/pages/Search/index.jsx index 478892645..74ed43ac8 100644 --- a/src/pages/Search/index.jsx +++ b/src/pages/Search/index.jsx @@ -97,6 +97,7 @@ const Search = () => { text: error.message, }); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }) .finally(() => { setLoading(false); diff --git a/src/pages/Upload/File/index.jsx b/src/pages/Upload/File/index.jsx index 391ba0109..ae7397cea 100644 --- a/src/pages/Upload/File/index.jsx +++ b/src/pages/Upload/File/index.jsx @@ -124,6 +124,7 @@ const UploadFile = () => { .finally(() => { setLoading(false); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }; const handleChange = (e) => { diff --git a/src/pages/Upload/Server/index.jsx b/src/pages/Upload/Server/index.jsx index 7615b7291..3e7523ded 100644 --- a/src/pages/Upload/Server/index.jsx +++ b/src/pages/Upload/Server/index.jsx @@ -147,6 +147,7 @@ const UploadFromServer = () => { text: error.message, }); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }, []); return ( diff --git a/src/pages/Upload/Url/index.jsx b/src/pages/Upload/Url/index.jsx index 0fb03836f..730dece8f 100644 --- a/src/pages/Upload/Url/index.jsx +++ b/src/pages/Upload/Url/index.jsx @@ -134,6 +134,7 @@ const UploadFromUrl = () => { .finally(() => { setLoading(false); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }; const handleChange = (e) => { @@ -203,6 +204,7 @@ const UploadFromUrl = () => { text: error.message, }); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }, []); return ( diff --git a/src/pages/Upload/Vcs/index.jsx b/src/pages/Upload/Vcs/index.jsx index d6f060564..78910c8b0 100644 --- a/src/pages/Upload/Vcs/index.jsx +++ b/src/pages/Upload/Vcs/index.jsx @@ -144,6 +144,7 @@ const UploadFromVcs = () => { .finally(() => { setLoading(false); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }; const handleChange = (e) => { @@ -213,6 +214,7 @@ const UploadFromVcs = () => { .catch((error) => { handleError(error, setMessage); setShowMessage(true); + setTimeout(() => setShowMessage(false), 2000); }); }, []); return (