summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view/post_attachment.jsx
diff options
context:
space:
mode:
authorAlex Ford <alexrford@users.noreply.github.com>2017-07-07 18:29:32 +0100
committerJoram Wilander <jwawilander@gmail.com>2017-07-07 13:29:32 -0400
commitb03b9d736297a536bb1385c80f76f55473c9f637 (patch)
tree02624e221c072f1c6d70e01e29caf41645337b64 /webapp/components/post_view/post_attachment.jsx
parente6ca2974cd504b26eee2549deb59b924daa4a104 (diff)
downloadchat-b03b9d736297a536bb1385c80f76f55473c9f637.tar.gz
chat-b03b9d736297a536bb1385c80f76f55473c9f637.tar.bz2
chat-b03b9d736297a536bb1385c80f76f55473c9f637.zip
Minor fixes based on lgtm.com alerts (#6819)
* Remove a couple of superfluous trailing arguments * Simplify assignment logic in a couple of places * Modify some potentially inconsistent setState calls to use the function form * Fix eslint errors
Diffstat (limited to 'webapp/components/post_view/post_attachment.jsx')
-rw-r--r--webapp/components/post_view/post_attachment.jsx9
1 files changed, 5 insertions, 4 deletions
diff --git a/webapp/components/post_view/post_attachment.jsx b/webapp/components/post_view/post_attachment.jsx
index b7bd1ade9..d7b1ee774 100644
--- a/webapp/components/post_view/post_attachment.jsx
+++ b/webapp/components/post_view/post_attachment.jsx
@@ -55,10 +55,11 @@ export default class PostAttachment extends React.PureComponent {
toggleCollapseState(e) {
e.preventDefault();
-
- this.setState({
- text: this.state.collapsed ? this.state.uncollapsedText : this.state.collapsedText,
- collapsed: !this.state.collapsed
+ this.setState((prevState) => {
+ return {
+ text: prevState.collapsed ? prevState.uncollapsedText : prevState.collapsedText,
+ collapsed: !prevState.collapsed
+ };
});
}