From fb4cffdd1c1b3c9c7df96462d35727116452b5f4 Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Wed, 14 Feb 2024 12:46:52 +0530 Subject: [PATCH] fix: infinity loader in the issue description in issue peek overview and issue detail page (#3656) --- web/components/issues/description-form.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/web/components/issues/description-form.tsx b/web/components/issues/description-form.tsx index b7601ef52..452e37e75 100644 --- a/web/components/issues/description-form.tsx +++ b/web/components/issues/description-form.tsx @@ -13,7 +13,6 @@ import { TIssueOperations } from "./issue-detail"; import { FileService } from "services/file.service"; import { useMention, useWorkspace } from "hooks/store"; import { observer } from "mobx-react"; -import { isNil } from "lodash"; export interface IssueDescriptionFormValues { name: string; @@ -79,13 +78,13 @@ export const IssueDescriptionForm: FC = observer((props) => { }, [issue.id]); // TODO: verify the exhaustive-deps warning useEffect(() => { - if (issue.description_html) { + if (["", undefined, null].includes(localIssueDescription.description_html)) { setLocalIssueDescription((state) => { - if (!isNil(state.description_html)) return state; - return { id: issue.id, description_html: issue.description_html }; + if (!["", undefined, null].includes(state.description_html)) return state; + return { id: issue.id, description_html: issue.description_html || "

" }; }); } - }, [issue.description_html]); + }, [issue.description_html, localIssueDescription.description_html, issue.id]); const handleDescriptionFormSubmit = useCallback( async (formData: Partial) => { @@ -177,7 +176,7 @@ export const IssueDescriptionForm: FC = observer((props) => { {errors.name ? errors.name.message : null}
- {issue.description_html ? ( + {localIssueDescription.description_html ? (