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.
This commit is contained in:
Christopher Gurnee 2021-11-30 18:21:28 -05:00
parent 9c102b9dc1
commit 854f56e6f2

View file

@ -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)