[WEB-1361] fix: comments access specifier mutation issue. (#4515)

This commit is contained in:
Prateek Shourya 2024-05-20 11:32:00 +05:30 committed by GitHub
parent 915ea8a81c
commit fe4dea1474
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,5 @@
import { FC, ReactNode } from "react"; import { FC, ReactNode } from "react";
import { observer } from "mobx-react";
import { MessageCircle } from "lucide-react"; import { MessageCircle } from "lucide-react";
// hooks // hooks
import { calculateTimeAgo } from "@/helpers/date-time.helper"; import { calculateTimeAgo } from "@/helpers/date-time.helper";
@ -12,7 +13,7 @@ type TIssueCommentBlock = {
children: ReactNode; children: ReactNode;
}; };
export const IssueCommentBlock: FC<TIssueCommentBlock> = (props) => { export const IssueCommentBlock: FC<TIssueCommentBlock> = observer((props) => {
const { commentId, ends, quickActions, children } = props; const { commentId, ends, quickActions, children } = props;
// hooks // hooks
const { const {
@ -63,4 +64,4 @@ export const IssueCommentBlock: FC<TIssueCommentBlock> = (props) => {
</div> </div>
</div> </div>
); );
}; });

View File

@ -1,4 +1,5 @@
import { FC, useEffect, useRef, useState } from "react"; import { FC, useEffect, useRef, useState } from "react";
import { observer } from "mobx-react";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { Check, Globe2, Lock, Pencil, Trash2, X } from "lucide-react"; import { Check, Globe2, Lock, Pencil, Trash2, X } from "lucide-react";
import { EditorReadOnlyRefApi, EditorRefApi } from "@plane/lite-text-editor"; import { EditorReadOnlyRefApi, EditorRefApi } from "@plane/lite-text-editor";
@ -28,7 +29,7 @@ type TIssueCommentCard = {
disabled?: boolean; disabled?: boolean;
}; };
export const IssueCommentCard: FC<TIssueCommentCard> = (props) => { export const IssueCommentCard: FC<TIssueCommentCard> = observer((props) => {
const { const {
workspaceSlug, workspaceSlug,
projectId, projectId,
@ -90,7 +91,7 @@ export const IssueCommentCard: FC<TIssueCommentCard> = (props) => {
quickActions={ quickActions={
<> <>
{!disabled && currentUser?.id === comment.actor && ( {!disabled && currentUser?.id === comment.actor && (
<CustomMenu ellipsis> <CustomMenu ellipsis closeOnSelect>
<CustomMenu.MenuItem onClick={() => setIsEditing(true)} className="flex items-center gap-1"> <CustomMenu.MenuItem onClick={() => setIsEditing(true)} className="flex items-center gap-1">
<Pencil className="h-3 w-3" /> <Pencil className="h-3 w-3" />
Edit comment Edit comment
@ -196,4 +197,4 @@ export const IssueCommentCard: FC<TIssueCommentCard> = (props) => {
</> </>
</IssueCommentBlock> </IssueCommentBlock>
); );
}; });