From 8e44e72d8e7d27f9155b00046307599cf1dcc2e2 Mon Sep 17 00:00:00 2001 From: Sean King Date: Fri, 9 Oct 2020 14:52:44 -0600 Subject: [PATCH 1/2] Don't call updateStatusLinks in ComponentDidMount --- app/soapbox/components/status_content.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/soapbox/components/status_content.js b/app/soapbox/components/status_content.js index de85781c8..f83baedf3 100644 --- a/app/soapbox/components/status_content.js +++ b/app/soapbox/components/status_content.js @@ -70,10 +70,6 @@ export default class StatusContent extends React.PureComponent { } } - componentDidMount() { - this._updateStatusLinks(); - } - componentDidUpdate() { this._updateStatusLinks(); } From dcc21221a569b8eda83d132f8c33ed701a3328af Mon Sep 17 00:00:00 2001 From: Sean King Date: Fri, 9 Oct 2020 15:27:07 -0600 Subject: [PATCH 2/2] Set collapse in a totally different function instead --- app/soapbox/components/status_content.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/soapbox/components/status_content.js b/app/soapbox/components/status_content.js index f83baedf3..aae081fc2 100644 --- a/app/soapbox/components/status_content.js +++ b/app/soapbox/components/status_content.js @@ -58,7 +58,15 @@ export default class StatusContent extends React.PureComponent { link.setAttribute('title', link.href); } } + } + setCollapse() { + const node = this.node; + + if (!node) { + return; + } + if ( this.props.collapsable && this.props.onClick @@ -70,7 +78,13 @@ export default class StatusContent extends React.PureComponent { } } + componentDidMount() { + this.setCollapse(); + this._updateStatusLinks(); + } + componentDidUpdate() { + this.setCollapse(); this._updateStatusLinks(); }