fix(修复错误调用React HOOK的问题):

(cherry picked from commit f0f144d557535e5bd7caf975d693379cc129652b)
This commit is contained in:
anime
2024-12-03 19:40:04 +08:00
parent f2c3d9242a
commit 7726363c69

View File

@@ -27,7 +27,7 @@ const NotionPage = ({ post, className }) => {
})
const zoomRef = useRef(zoom ? zoom.clone() : null)
const IMAGE_ZOOM_IN_WIDTH = siteConfig('IMAGE_ZOOM_IN_WIDTH', 1200)
// 页面首次打开时执行的勾子
useEffect(() => {
// 检测当前的url并自动滚动到对应目标
@@ -64,7 +64,7 @@ const NotionPage = ({ post, className }) => {
// 替换为更高清的图像
mutation?.target?.setAttribute(
'src',
compressImage(src, siteConfig('IMAGE_ZOOM_IN_WIDTH', 1200))
compressImage(src, IMAGE_ZOOM_IN_WIDTH)
)
}, 800)
}