Skip to content

Commit

Permalink
assets: optimise detection if timeline was updated
Browse files Browse the repository at this point in the history
  • Loading branch information
kpsherva committed Sep 17, 2024
1 parent e6bbe25 commit a5771b3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class TimelineFeed extends Component {
componentDidUpdate(prevProps) {
const { timeline } = this.props;

if (!_.isEqual(prevProps.timeline, timeline) && timeline?.hits?.total > 0) {
const hasComments = timeline?.hits?.total > 0;
const hasNewComments = prevProps.timeline?.hits?.total !== timeline?.hits?.total;
if (hasComments && hasNewComments) {
window.MathJax?.typeset();
}
}
Expand Down

0 comments on commit a5771b3

Please sign in to comment.