-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
timeline feed: render mathematical content in the request comments #403
timeline feed: render mathematical content in the request comments #403
Conversation
anikachurilova
commented
Aug 20, 2024
- closes LaTeX rendering CERNDocumentServer/cds-rdm#133
invenio_requests/assets/semantic-ui/js/invenio_requests/timeline/TimelineFeed.js
Outdated
Show resolved
Hide resolved
b8819b4
to
0d4d1ab
Compare
componentDidUpdate(prevProps) { | ||
const { timeline } = this.props; | ||
|
||
if (!_.isEqual(prevProps.timeline, timeline) && timeline?.hits?.total > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While comparing timeline
looks correct, it might be quite expensive... is there any other field, in the timeline
object, that tell us that something changed?
I would also change the order of the conditions for performance:
timeline?.hits?.total > 0 && ...
ad07bd2
to
1dca41a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed with @sakshamarora1 LGTU! 🚀
const hasComments = timeline?.hits?.total > 0; | ||
const hasNewComments = prevProps.timeline?.hits?.total !== timeline?.hits?.total; | ||
if (hasComments && hasNewComments) { | ||
window.MathJax?.typeset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing mathjax as a requirement, how do we know this module has it in the window namespace?