diff options
Diffstat (limited to 'webui/src/pages/bug/CommentForm.tsx')
-rw-r--r-- | webui/src/pages/bug/CommentForm.tsx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/webui/src/pages/bug/CommentForm.tsx b/webui/src/pages/bug/CommentForm.tsx index 1a7ebc29..395b955d 100644 --- a/webui/src/pages/bug/CommentForm.tsx +++ b/webui/src/pages/bug/CommentForm.tsx @@ -8,6 +8,7 @@ import CommentInput from '../../components/CommentInput/CommentInput'; import CloseBugButton from 'src/components/CloseBugButton/CloseBugButton'; import CloseBugWithCommentButton from 'src/components/CloseBugWithCommentButton/CloseBugWithCommentButton'; import ReopenBugButton from 'src/components/ReopenBugButton/ReopenBugButton'; +import ReopenBugWithCommentButton from 'src/components/ReopenBugWithCommentButton/ReopenBugWithCommentButton'; import { BugFragment } from './Bug.generated'; import { useAddCommentMutation } from './CommentForm.generated'; @@ -80,12 +81,27 @@ function CommentForm({ bug }: Props) { function getBugStatusButton() { if (bug.status === 'OPEN' && issueComment.length > 0) { - return <CloseBugWithCommentButton bug={bug} comment={issueComment} />; + return ( + <CloseBugWithCommentButton + bug={bug} + comment={issueComment} + postClick={resetForm} + /> + ); } if (bug.status === 'OPEN') { return <CloseBugButton bug={bug} />; } - return <ReopenBugButton bug={bug} disabled={issueComment.length > 0} />; + if (bug.status === 'CLOSED' && issueComment.length > 0) { + return ( + <ReopenBugWithCommentButton + bug={bug} + comment={issueComment} + postClick={resetForm} + /> + ); + } + return <ReopenBugButton bug={bug} />; } return ( |