From 438d502c896026141960b645a69ee05474c010bc Mon Sep 17 00:00:00 2001 From: Fang Date: Thu, 6 Feb 2020 17:05:30 +0100 Subject: [PATCH] link fe: remove unused comment loading logic This never triggers anymore, comments loading always happens in onMount. --- .../link/src/js/components/lib/comments.js | 15 --------------- pkg/interface/link/src/js/components/link.js | 4 +++- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/pkg/interface/link/src/js/components/lib/comments.js b/pkg/interface/link/src/js/components/lib/comments.js index aaaa84464b..bd40f39a80 100644 --- a/pkg/interface/link/src/js/components/lib/comments.js +++ b/pkg/interface/link/src/js/components/lib/comments.js @@ -22,21 +22,6 @@ export class Comments extends Component { } } - componentDidUpdate(prevProps) { - if (prevProps !== this.props) { - let page = "page" + this.props.commentPage; - if ( (!this.props.comments || !this.props.comments[page]) && - (this.state.requested !== this.props.commentPage)) { - this.setState({requested: this.props.commentPage}); - api.getCommentsPage( - this.props.path, - this.props.url, - this.props.commentPage - ); - } - } - } - render() { let props = this.props; diff --git a/pkg/interface/link/src/js/components/link.js b/pkg/interface/link/src/js/components/link.js index ad17af0b96..70c5d43d79 100644 --- a/pkg/interface/link/src/js/components/link.js +++ b/pkg/interface/link/src/js/components/link.js @@ -27,7 +27,9 @@ export class LinkDetail extends Component { componentDidMount() { // if we have no preloaded data, and we aren't expecting it, get it if (!this.props.data.url || !this.props.url) { - api.getSubmission(this.props.path, this.props.url, this.updateData.bind(this)); + api.getSubmission( + this.props.path, this.props.url, this.updateData.bind(this) + ); } this.updateTimeSinceNewestMessageInterval = setInterval( () => {