Skip to content

Commit

Permalink
timeline feed: render mathematical content in the request comments
Browse files Browse the repository at this point in the history
  • Loading branch information
anikachurilova authored and kpsherva committed Sep 17, 2024
1 parent e29eb29 commit e6bbe25
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Pagination } from "../components/Pagination";
import RequestsFeed from "../components/RequestsFeed";
import { TimelineCommentEditor } from "../timelineCommentEditor";
import { TimelineCommentEventControlled } from "../timelineCommentEventControlled";
import _ from "lodash";

class TimelineFeed extends Component {
constructor(props) {
Expand All @@ -31,6 +32,14 @@ class TimelineFeed extends Component {
getTimelineWithRefresh();
}

componentDidUpdate(prevProps) {
const { timeline } = this.props;

if (!_.isEqual(prevProps.timeline, timeline) && timeline?.hits?.total > 0) {
window.MathJax?.typeset();
}
}

componentWillUnmount() {
const { timelineStopRefresh } = this.props;
timelineStopRefresh();
Expand Down

0 comments on commit e6bbe25

Please sign in to comment.