summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/post_view')
-rw-r--r--webapp/components/post_view/post_attachment.jsx9
-rw-r--r--webapp/components/post_view/post_body_additional_content.jsx4
2 files changed, 8 insertions, 5 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
+ };
});
}
diff --git a/webapp/components/post_view/post_body_additional_content.jsx b/webapp/components/post_view/post_body_additional_content.jsx
index 107c75778..2782c346f 100644
--- a/webapp/components/post_view/post_body_additional_content.jsx
+++ b/webapp/components/post_view/post_body_additional_content.jsx
@@ -62,7 +62,9 @@ export default class PostBodyAdditionalContent extends React.PureComponent {
}
toggleEmbedVisibility() {
- this.setState({embedVisible: !this.state.embedVisible});
+ this.setState((prevState) => {
+ return {embedVisible: !prevState.embedVisible};
+ });
}
getSlackAttachment() {