aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src
diff options
context:
space:
mode:
authorSascha <GlancingMind@outlook.com>2021-03-18 12:08:19 +0100
committerSascha <GlancingMind@outlook.com>2021-03-19 17:52:43 +0100
commit142adfd2b15dda3a7b9353c046f5858496012876 (patch)
tree8bdfb87a0d6572620287bc70948db0a10fba4400 /webui/src
parentb06f7c781620c967e939577fc92e1265cdff6485 (diff)
downloadgit-bug-142adfd2b15dda3a7b9353c046f5858496012876.tar.gz
Update message view after editing
Diffstat (limited to 'webui/src')
-rw-r--r--webui/src/pages/bug/Message.tsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/webui/src/pages/bug/Message.tsx b/webui/src/pages/bug/Message.tsx
index 7455104b..adb3057c 100644
--- a/webui/src/pages/bug/Message.tsx
+++ b/webui/src/pages/bug/Message.tsx
@@ -72,9 +72,10 @@ type Props = {
op: AddCommentFragment | CreateFragment;
};
-function Message({ bug, op: comment }: Props) {
+function Message({ bug, op }: Props) {
const classes = useStyles();
const [editMode, switchToEditMode] = useState(false);
+ const [comment, setComment] = useState(op);
const editComment = (id: String) => {
switchToEditMode(true);
@@ -117,8 +118,8 @@ function Message({ bug, op: comment }: Props) {
switchToEditMode(false);
};
- const onPostSubmit = (comments: AddCommentFragment | CreateFragment) => {
- console.log('posted: ' + comments.message);
+ const onPostSubmit = (comment: AddCommentFragment | CreateFragment) => {
+ setComment(comment);
switchToEditMode(false);
};