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

View File

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