From 854f56e6f2e9b9defe83ab2b3c759dcc836428ec Mon Sep 17 00:00:00 2001 From: Christopher Gurnee Date: Tue, 30 Nov 2021 18:21:28 -0500 Subject: [PATCH] Fix bug where status is sometimes stuck "loading" This was introduced in 9e343fc. There may still be a race condition here, however it should occur far less frequently than before. --- src/pages/thread/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/thread/index.js b/src/pages/thread/index.js index 620c8aa..d6a998f 100644 --- a/src/pages/thread/index.js +++ b/src/pages/thread/index.js @@ -60,7 +60,10 @@ class Thread extends React.Component { this.setState({ post: { subreddit, id: threadID } }) }) }) - .finally(() => this.props.global.setLoading('Loading comments from Pushshift...')) + .finally(() => { + if (this.state.loadingComments) + this.props.global.setLoading('Loading comments from Pushshift...') + }) // Get comment ids from pushshift getPushshiftComments(threadID)