diff options
author | Sascha <GlancingMind@outlook.com> | 2021-03-18 12:07:09 +0100 |
---|---|---|
committer | Sascha <GlancingMind@outlook.com> | 2021-03-19 17:52:35 +0100 |
commit | b06f7c781620c967e939577fc92e1265cdff6485 (patch) | |
tree | 36169270af0075d2e61865b89096e7944560a242 /webui/src/pages/bug | |
parent | 9fb033ef191a23b1338e0fdfe8ab1f462165b99d (diff) | |
download | git-bug-b06f7c781620c967e939577fc92e1265cdff6485.tar.gz |
Reduced arbitary variable names
Diffstat (limited to 'webui/src/pages/bug')
-rw-r--r-- | webui/src/pages/bug/EditCommentForm.tsx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/webui/src/pages/bug/EditCommentForm.tsx b/webui/src/pages/bug/EditCommentForm.tsx index 7823d75e..0794c3ef 100644 --- a/webui/src/pages/bug/EditCommentForm.tsx +++ b/webui/src/pages/bug/EditCommentForm.tsx @@ -63,10 +63,14 @@ function EditCommentForm({ bug, comment, onCancelClick, onPostSubmit }: Props) { }, }, }).then((result) => { - const comments = result.data?.editComment.bug.timeline.comments; - const coms = comments as (AddCommentFragment | CreateFragment)[]; - const res = coms.find((elem) => elem.id === comment.id); - if (onPostSubmit) onPostSubmit(res); + const comments = result.data?.editComment.bug.timeline.comments as ( + | AddCommentFragment + | CreateFragment + )[]; + // NOTE Searching for the changed comment could be dropped if GraphQL get + // filter by id argument for timelineitems + const modifiedComment = comments.find((elem) => elem.id === comment.id); + if (onPostSubmit) onPostSubmit(modifiedComment); }); resetForm(); }; |