Skip to content

Commit

Permalink
impl
Browse files Browse the repository at this point in the history
  • Loading branch information
caichi-t committed Nov 20, 2024
1 parent 9a3b5fb commit 0cd8ddc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions web/src/components/molecules/Common/CommentsPanel/Comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ const CommentMolecule: React.FC<Props> = ({

const handleSubmit = useCallback(async () => {
try {
await onCommentUpdate?.(comment.id, value);
if (comment.content !== value) {
await onCommentUpdate?.(comment.id, value);
}
} catch (info) {
console.log("Validate Failed:", info);
} finally {
setShowEditor(false);
}
}, [value, comment.id, onCommentUpdate]);
}, [comment.content, comment.id, value, onCommentUpdate]);

const fromNow = useMemo(
() => dayjs(comment.createdAt?.toString()).fromNow(),
Expand Down
6 changes: 4 additions & 2 deletions web/src/components/molecules/Request/Details/Comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ const ThreadCommentMolecule: React.FC<Props> = ({

const handleSubmit = useCallback(async () => {
try {
await onCommentUpdate?.(comment.id, value);
if (comment.content !== value) {
await onCommentUpdate?.(comment.id, value);
}
} catch (info) {
console.log("Validate Failed:", info);
} finally {
setShowEditor(false);
}
}, [value, comment.id, onCommentUpdate]);
}, [comment.content, comment.id, value, onCommentUpdate]);

const fromNow = useMemo(
() => dayjs(comment.createdAt?.toString()).fromNow(),
Expand Down

0 comments on commit 0cd8ddc

Please sign in to comment.