[WEB-2348] fix: allow updating comments with just mentions in them (#5471)
* fix: accept mentions while updating comments * chore: remove console log * chore: update empty string helper function
This commit is contained in:
parent
03c28a11e8
commit
bac5b53ffb
7 changed files with 46 additions and 27 deletions
|
|
@ -5,7 +5,7 @@ import { EditorRefApi, ILiteTextEditor, LiteTextEditorWithRef } from "@plane/edi
|
|||
import { IssueCommentToolbar } from "@/components/editor";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import { isEmptyHtmlString } from "@/helpers/string.helper";
|
||||
import { isCommentEmpty } from "@/helpers/string.helper";
|
||||
// hooks
|
||||
import { useMention } from "@/hooks/use-mention";
|
||||
// services
|
||||
|
|
@ -33,10 +33,7 @@ export const LiteTextEditor = React.forwardRef<EditorRefApi, LiteTextEditorWrapp
|
|||
function isMutableRefObject<T>(ref: React.ForwardedRef<T>): ref is React.MutableRefObject<T | null> {
|
||||
return !!ref && typeof ref === "object" && "current" in ref;
|
||||
}
|
||||
const isEmpty =
|
||||
props.initialValue?.trim() === "" ||
|
||||
props.initialValue === "<p></p>" ||
|
||||
(isEmptyHtmlString(props.initialValue ?? "") && !props.initialValue?.includes("mention-component"));
|
||||
const isEmpty = isCommentEmpty(props.initialValue);
|
||||
|
||||
return (
|
||||
<div className="border border-custom-border-200 rounded p-3 space-y-3">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue