Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(snackbar): fixed the removal of snackbar #155

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/pages/Admin/Group/Create/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const GroupCreate = () => {
.finally(() => {
setLoading(false);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
};
return (
Expand Down
3 changes: 3 additions & 0 deletions src/pages/Admin/Users/Delete/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,15 @@ const DeleteUser = () => {
.finally(() => {
setLoading(false);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
} else {
setMessage({
type: "danger",
text: "Deletion not confirmed",
});
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
}
};

Expand All @@ -109,6 +111,7 @@ const DeleteUser = () => {
.catch((error) => {
handleError(error, setMessage);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}, []);
return (
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Browse/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const Browse = () => {
text: "Error occured in fetching",
});
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}, [browseData]);

Expand Down Expand Up @@ -162,6 +163,7 @@ const Browse = () => {
text: "Error occured in fetching folder list",
});
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}, []);

Expand Down
2 changes: 2 additions & 0 deletions src/pages/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const Home = ({ location }) => {
setLoading(false);
setErrorMessage(err.message);
setShowError(true);
setTimeout(() => setShowError(false), 2000);
});
};

Expand All @@ -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]);
Expand Down
1 change: 1 addition & 0 deletions src/pages/Jobs/ScheduleAgents/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const ScheduleAgents = () => {
.finally(() => {
setLoading(false);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
};
const handleChange = (e) => {
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Organize/Folder/Create/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const CreateFolder = () => {
.finally(() => {
setLoading(false);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
};

Expand All @@ -96,6 +97,7 @@ const CreateFolder = () => {
.catch((error) => {
handleError(error, setMessage);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}, []);

Expand Down
2 changes: 2 additions & 0 deletions src/pages/Organize/Folder/Delete/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const DeleteFolder = () => {
.finally(() => {
setLoading(false);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
};

Expand All @@ -99,6 +100,7 @@ const DeleteFolder = () => {
.catch((error) => {
handleError(error, setMessage);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}, []);
return (
Expand Down
3 changes: 3 additions & 0 deletions src/pages/Organize/Folder/Edit/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const EditFolder = () => {
.finally(() => {
setLoading(false);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
};

Expand All @@ -96,6 +97,7 @@ const EditFolder = () => {
.catch((error) => {
handleError(error, setMessage);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}, []);

Expand All @@ -107,6 +109,7 @@ const EditFolder = () => {
.catch((error) => {
handleError(error, setMessage);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}, [id]);

Expand Down
3 changes: 3 additions & 0 deletions src/pages/Organize/Folder/Move/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const MoveFolder = () => {
})
.finally(() => {
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
};

Expand All @@ -97,6 +98,7 @@ const MoveFolder = () => {
})
.finally(() => {
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
};

Expand All @@ -108,6 +110,7 @@ const MoveFolder = () => {
.catch((error) => {
handleError(error, setMessage);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}, []);

Expand Down
2 changes: 2 additions & 0 deletions src/pages/Organize/Folder/Unlink/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const UnlinkFolder = () => {
.finally(() => {
setLoading(false);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
};

Expand All @@ -100,6 +101,7 @@ const UnlinkFolder = () => {
.catch((error) => {
handleError(error, setMessage);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}, []);
return (
Expand Down
1 change: 1 addition & 0 deletions src/pages/Organize/License/CandidateLicense/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const AdviceLicenses = () => {
text: error.message,
});
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}, [licenseData]);
return (
Expand Down
1 change: 1 addition & 0 deletions src/pages/Organize/License/Create/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const AddCandidateLicense = () => {
.finally(() => {
setLoading(false);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
};
return (
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Organize/Uploads/Delete/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const UploadDelete = () => {
.finally(() => {
setLoading(false);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
});
} else {
Expand All @@ -113,6 +114,7 @@ const UploadDelete = () => {
type: "danger",
text: "Select the uploads to delete",
});
setTimeout(() => setShowMessage(false), 2000);
}
};

Expand Down
3 changes: 3 additions & 0 deletions src/pages/Organize/Uploads/Edit/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const UploadEdit = () => {
.catch((error) => {
handleError(error, setMessage);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
getUploadsFolderId(editUploadFolderData.folderId)
.then((res) => {
Expand All @@ -93,6 +94,7 @@ const UploadEdit = () => {
.catch((error) => {
handleError(error, setMessage);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
if (editUploadFolderData.uploadId) {
getUploadById(editUploadFolderData.uploadId)
Expand All @@ -106,6 +108,7 @@ const UploadEdit = () => {
.catch((error) => {
handleError(error, setMessage);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}
}, [editUploadFolderData.folderId, editUploadFolderData.uploadId]);
Expand Down
8 changes: 8 additions & 0 deletions src/pages/Organize/Uploads/Move/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const UploadMove = () => {
.catch((error) => {
handleError(error, setMessage);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
};

Expand All @@ -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 {
Expand All @@ -117,6 +120,7 @@ const UploadMove = () => {
type: "danger",
text: "Select the uploads to move",
});
setTimeout(() => setShowMessage(false), 2000);
}
};

Expand All @@ -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 {
Expand All @@ -145,6 +151,7 @@ const UploadMove = () => {
type: "danger",
text: "Select the uploads to copy",
});
setTimeout(() => setShowMessage(false), 2000);
}
};
useEffect(() => {
Expand All @@ -155,6 +162,7 @@ const UploadMove = () => {
.catch((error) => {
handleError(error, setMessage);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
getUploadList();
}, [folderId]);
Expand Down
1 change: 1 addition & 0 deletions src/pages/Search/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const Search = () => {
text: error.message,
});
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
})
.finally(() => {
setLoading(false);
Expand Down
1 change: 1 addition & 0 deletions src/pages/Upload/File/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ const UploadFile = () => {
.finally(() => {
setLoading(false);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
};
const handleChange = (e) => {
Expand Down
1 change: 1 addition & 0 deletions src/pages/Upload/Server/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ const UploadFromServer = () => {
text: error.message,
});
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}, []);
return (
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Upload/Url/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ const UploadFromUrl = () => {
.finally(() => {
setLoading(false);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
};
const handleChange = (e) => {
Expand Down Expand Up @@ -203,6 +204,7 @@ const UploadFromUrl = () => {
text: error.message,
});
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}, []);
return (
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Upload/Vcs/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ const UploadFromVcs = () => {
.finally(() => {
setLoading(false);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
};
const handleChange = (e) => {
Expand Down Expand Up @@ -213,6 +214,7 @@ const UploadFromVcs = () => {
.catch((error) => {
handleError(error, setMessage);
setShowMessage(true);
setTimeout(() => setShowMessage(false), 2000);
});
}, []);
return (
Expand Down