瀏覽代碼

Merge pull request #1191 from Yidadaa/bugfix-0501

fixup
Yifei Zhang 1 年之前
父節點
當前提交
5dbb6afc60
共有 1 個文件被更改,包括 9 次插入0 次删除
  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 (