diff --git a/apps/space/components/issues/peek-overview/comment-detail-card.tsx b/apps/space/components/issues/peek-overview/comment-detail-card.tsx index 9b2a13082..f3a9e6834 100644 --- a/apps/space/components/issues/peek-overview/comment-detail-card.tsx +++ b/apps/space/components/issues/peek-overview/comment-detail-card.tsx @@ -21,43 +21,29 @@ type Props = { export const CommentCard: React.FC = observer((props) => { const { comment, workspaceSlug } = props; // store - const { user: userStore, issue: issueStore, issueDetails: issueDetailStore } = useMobxStore(); + const { user: userStore, issueDetails: issueDetailStore } = useMobxStore(); // states const [isEditing, setIsEditing] = useState(false); const { formState: { isSubmitting }, handleSubmit, - setFocus, control, } = useForm({ defaultValues: { comment_html: comment.comment_html }, }); - const handleDelete = async () => { + const handleDelete = () => { if (!workspaceSlug || !issueDetailStore.peekId) return; - - await issueDetailStore.deleteIssueComment(workspaceSlug, comment.project, issueDetailStore.peekId, comment.id); + issueDetailStore.deleteIssueComment(workspaceSlug, comment.project, issueDetailStore.peekId, comment.id); }; const handleCommentUpdate = async (formData: Comment) => { if (!workspaceSlug || !issueDetailStore.peekId) return; - - console.log("formData", formData); - const response = await issueDetailStore.updateIssueComment( - workspaceSlug, - comment.project, - issueDetailStore.peekId, - comment.id, - formData - ); + issueDetailStore.updateIssueComment(workspaceSlug, comment.project, issueDetailStore.peekId, comment.id, formData); setIsEditing(false); }; - useEffect(() => { - isEditing && setFocus("comment_html"); - }, [isEditing, setFocus]); - return (
@@ -133,6 +119,7 @@ export const CommentCard: React.FC = observer((props) => {
+ {comment.comment_html} = observer((props) => {