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: toast alert inconsistency #2730

Merged
merged 1 commit into from
Nov 8, 2023
Merged
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
fix: toast alert inconsistency
sabith-tu committed Nov 8, 2023
commit a20338a9a18bfd5943b2225804ca4e1098f7ef97
5 changes: 5 additions & 0 deletions web/components/modules/delete-module-modal.tsx
Original file line number Diff line number Diff line change
@@ -45,6 +45,11 @@ export const DeleteModuleModal: React.FC<Props> = observer((props) => {
.then(() => {
if (moduleId) router.push(`/${workspaceSlug}/projects/${data.project}/modules`);
handleClose();
setToastAlert({
type: "success",
title: "Success!",
message: "Module deleted successfully.",
});
})
.catch(() => {
setToastAlert({
5 changes: 5 additions & 0 deletions web/components/project/delete-project-modal.tsx
Original file line number Diff line number Diff line change
@@ -62,6 +62,11 @@ export const DeleteProjectModal: React.FC<DeleteProjectModal> = (props) => {
if (projectId && projectId.toString() === project.id) router.push(`/${workspaceSlug}/projects`);

handleClose();
setToastAlert({
type: "success",
title: "Success!",
message: "Project deleted successfully.",
});
})
.catch(() => {
setToastAlert({
9 changes: 8 additions & 1 deletion web/components/views/modal.tsx
Original file line number Diff line number Diff line change
@@ -32,7 +32,14 @@ export const CreateUpdateProjectViewModal: FC<Props> = observer((props) => {
const createView = async (payload: IProjectView) => {
await projectViewsStore
.createView(workspaceSlug, projectId, payload)
.then(() => handleClose())
.then(() => {
handleClose();
setToastAlert({
type: "success",
title: "Success!",
message: "View created successfully.",
});
})
.catch(() =>
setToastAlert({
type: "error",