diff --git a/napcat.webui/src/components/file_manage/file_preview_modal.tsx b/napcat.webui/src/components/file_manage/file_preview_modal.tsx index 3bb23bfe..897d3a77 100644 --- a/napcat.webui/src/components/file_manage/file_preview_modal.tsx +++ b/napcat.webui/src/components/file_manage/file_preview_modal.tsx @@ -45,6 +45,12 @@ export default function FilePreviewModal({ } ) + useEffect(() => { + if (filePath) { + run() + } + }, [filePath]) + let contentElement = null if (!supportedPreviewExts.includes(ext)) { contentElement =
暂不支持预览此文件类型
@@ -68,12 +74,6 @@ export default function FilePreviewModal({ ) } - useEffect(() => { - if (filePath) { - run() - } - }, []) - return ( diff --git a/napcat.webui/src/components/file_manage/image_name_button.tsx b/napcat.webui/src/components/file_manage/image_name_button.tsx index cc3e2194..b1438558 100644 --- a/napcat.webui/src/components/file_manage/image_name_button.tsx +++ b/napcat.webui/src/components/file_manage/image_name_button.tsx @@ -58,6 +58,7 @@ export default function ImageNameButton({ run() } }, []) + return (