From 0d57ddfd237e7b8a2549a2e36e71de8b42600a9d Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Wed, 27 Jan 2021 11:11:25 +0100 Subject: [PATCH] Merge pull request #3603 from overleaf/msm-fix-react-mathjax-not-available Ignored MathJax setup when not available GitOrigin-RevId: 716af272070b15d3fa1c346bea611f0e1abbac33 --- .../frontend/js/features/chat/components/message-content.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/web/frontend/js/features/chat/components/message-content.js b/services/web/frontend/js/features/chat/components/message-content.js index a5776cf1ee..7172a6b28b 100644 --- a/services/web/frontend/js/features/chat/components/message-content.js +++ b/services/web/frontend/js/features/chat/components/message-content.js @@ -6,6 +6,9 @@ function MessageContent({ content }) { const root = useRef(null) useEffect(() => { + if (!(window.MathJax && window.MathJax.Hub)) { + return + } const MJHub = window.MathJax.Hub const inlineMathConfig = MJHub.config && MJHub.config.tex2jax.inlineMath const alreadyConfigured = inlineMathConfig.some(