Explorar o código

Merge pull request #1191 from Yidadaa/bugfix-0501

fixup
Yifei Zhang hai 1 ano
pai
achega
5dbb6afc60
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      app/components/markdown.tsx

+ 9 - 0
app/components/markdown.tsx

@@ -90,6 +90,15 @@ export function Markdown(
     }
   };
 
+  useEffect(() => {
+    setTimeout(() => {
+      if (!inView.current) {
+        checkInView();
+      }
+    }, 30);
+    // eslint-disable-next-line react-hooks/exhaustive-deps
+  }, []);
+
   checkInView();
 
   return (