From 5cfebb8dae33191fba9f2fbffeea3e762ca271d5 Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Thu, 29 Feb 2024 19:41:30 +0530 Subject: [PATCH] fix: issue description on last draft issue (#3846) --- web/components/issues/issue-modal/modal.tsx | 3 ++- web/components/workspace/sidebar-quick-action.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web/components/issues/issue-modal/modal.tsx b/web/components/issues/issue-modal/modal.tsx index dc73bc77a..1da02f0ac 100644 --- a/web/components/issues/issue-modal/modal.tsx +++ b/web/components/issues/issue-modal/modal.tsx @@ -100,8 +100,9 @@ export const CreateUpdateIssueModal: React.FC = observer((prop const fetchIssueDetail = async (issueId: string | undefined) => { if (!workspaceSlug) return; + if (!projectId || issueId === undefined) { - setDescription("

"); + setDescription(data?.description_html || "

"); return; } const response = await fetchIssue(workspaceSlug, projectId, issueId, isDraft ? "DRAFT" : "DEFAULT"); diff --git a/web/components/workspace/sidebar-quick-action.tsx b/web/components/workspace/sidebar-quick-action.tsx index 38d3e6b6a..dd2dd5c68 100644 --- a/web/components/workspace/sidebar-quick-action.tsx +++ b/web/components/workspace/sidebar-quick-action.tsx @@ -58,6 +58,7 @@ export const WorkspaceSidebarQuickAction = observer(() => { const draftIssues = storedValue ?? {}; if (workspaceSlug && draftIssues[workspaceSlug]) delete draftIssues[workspaceSlug]; setValue(draftIssues); + return Promise.resolve(); }; return ( @@ -66,7 +67,7 @@ export const WorkspaceSidebarQuickAction = observer(() => { isOpen={isDraftIssueModalOpen} onClose={() => setIsDraftIssueModalOpen(false)} data={workspaceDraftIssue ?? {}} - // storeType={storeType} + onSubmit={() => removeWorkspaceDraftIssue()} isDraft={true} />