From cf2e923b47bf60328fe3025b0437e04fb563d80a Mon Sep 17 00:00:00 2001 From: sharma01ketan Date: Tue, 8 Oct 2024 15:32:16 +0530 Subject: [PATCH] made minor improvements --- .../calendar/quick-add-issue-actions.tsx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/web/core/components/issues/issue-layouts/calendar/quick-add-issue-actions.tsx b/web/core/components/issues/issue-layouts/calendar/quick-add-issue-actions.tsx index 7b33215e44..9fa0d4cf32 100644 --- a/web/core/components/issues/issue-layouts/calendar/quick-add-issue-actions.tsx +++ b/web/core/components/issues/issue-layouts/calendar/quick-add-issue-actions.tsx @@ -8,7 +8,7 @@ import { PlusIcon } from "lucide-react"; // types import { ISearchIssueResponse, TIssue } from "@plane/types"; // ui -import { TOAST_TYPE, setToast, CustomMenu, setPromiseToast } from "@plane/ui"; +import { CustomMenu, setPromiseToast } from "@plane/ui"; // components import { ExistingIssuesListModal } from "@/components/core"; import { QuickAddIssueRoot } from "@/components/issues"; @@ -47,25 +47,19 @@ export const CalendarQuickAddIssueActions: FC = o const issueIds = data.map((i) => i.id); const updatePromise = Promise.all( data.map((issue) => updateIssue(workspaceSlug.toString(), projectId.toString(), issue.id, prePopulatedData ?? {})) - ).then(() => addIssuesToView?.(issueIds)) - console.log(issueIds.length) + ).then(() => addIssuesToView?.(issueIds)); + setPromiseToast(updatePromise, { - loading: `Adding ${issueIds.length>1 ? "issues" : "issue" } to cycle...`, + loading: `Adding ${issueIds.length > 1 ? "issues" : "issue"} to cycle...`, success: { title: "Success!", - message: () => `${issueIds.length>1 ? "Issues" : "Issue" } added to cycle successfully.`, + message: () => `${issueIds.length > 1 ? "Issues" : "Issue"} added to cycle successfully.`, }, error: { title: "Error!", message: (err) => err?.message || "Something went wrong. Please try again.", }, }); - - try { - await updatePromise; - } catch (error) { - console.error(error) - } }; const handleNewIssue = () => {