Read window.MathJax.Hub outside the timeout (#11431)

GitOrigin-RevId: 6a9f3cd2a7811059b7d1d95b411b37a41cb35b83
This commit is contained in:
Alf Eaton 2023-01-25 10:13:05 +00:00 committed by Copybot
parent 691438ee37
commit adca4980db

View file

@ -19,14 +19,11 @@ const MessageContent: FC<{ content: string }> = ({ content }) => {
// MathJax v2 typesetting
if (window.MathJax?.Hub) {
const { Hub } = window.MathJax
const timeout = setTimeout(() => {
configureMathJax()
window.MathJax.Hub.Queue([
'Typeset',
window.MathJax.Hub,
root.current,
])
Hub.Queue(['Typeset', Hub, root.current])
}, 0)
return () => clearTimeout(timeout)