Explorar o código

Merge pull request #3603 from overleaf/msm-fix-react-mathjax-not-available

Ignored MathJax setup when not available

GitOrigin-RevId: 716af272070b15d3fa1c346bea611f0e1abbac33
Miguel Serrano %!s(int64=5) %!d(string=hai) anos
pai
achega
0d57ddfd23

+ 3 - 0
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(