fix a problem error
This commit is contained in:
@@ -17,9 +17,10 @@ const CommentList: FC<Props> = ({ taskId, enabled = true }) => {
|
||||
const createComment = useCreateTaskComment();
|
||||
|
||||
const comments = getComments.data?.data ?? [];
|
||||
const trimmedContent = content.trim();
|
||||
const isSubmitDisabled = createComment.isPending || trimmedContent.length === 0;
|
||||
|
||||
const handleSubmit = () => {
|
||||
const trimmedContent = content.trim();
|
||||
if (!trimmedContent) return;
|
||||
|
||||
createComment.mutate(
|
||||
@@ -44,7 +45,7 @@ const CommentList: FC<Props> = ({ taskId, enabled = true }) => {
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleSubmit}
|
||||
disabled={createComment.isPending || !content.trim()}
|
||||
disabled={isSubmitDisabled}
|
||||
className="absolute top-2 left-2 z-10 h-7 px-2.5 rounded-lg bg-[#292D32] text-white text-[11px] disabled:opacity-50"
|
||||
>
|
||||
{t("taskmanager.task_detail.add_comment")}
|
||||
|
||||
Reference in New Issue
Block a user