mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 20:27:23 +00:00
feat: small file is unrequired to verity to download.
This commit is contained in:
@@ -702,20 +702,32 @@ function FileTile({ file }: { file: RFile }) {
|
||||
</p>
|
||||
</div>
|
||||
<div className={"flex flex-row items-center"}>
|
||||
<button
|
||||
ref={buttonRef}
|
||||
className={"btn btn-primary btn-soft btn-square"}
|
||||
onClick={() => {
|
||||
if (!app.cloudflareTurnstileSiteKey) {
|
||||
const link = network.getFileDownloadLink(file.id, "");
|
||||
window.open(link, "_blank");
|
||||
} else {
|
||||
showPopup(<CloudflarePopup file={file} />, buttonRef.current!);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<MdOutlineDownload size={24} />
|
||||
</button>
|
||||
{
|
||||
file.size > 10 * 1024 * 1024 ? (
|
||||
<button
|
||||
ref={buttonRef}
|
||||
className={"btn btn-primary btn-soft btn-square"}
|
||||
onClick={() => {
|
||||
if (!app.cloudflareTurnstileSiteKey) {
|
||||
const link = network.getFileDownloadLink(file.id, "");
|
||||
window.open(link, "_blank");
|
||||
} else {
|
||||
showPopup(<CloudflarePopup file={file} />, buttonRef.current!);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<MdOutlineDownload size={24} />
|
||||
</button>
|
||||
) : (
|
||||
<a
|
||||
href={network.getFileDownloadLink(file.id, "")}
|
||||
target="_blank"
|
||||
className={"btn btn-primary btn-soft btn-square"}
|
||||
>
|
||||
<MdOutlineDownload size={24} />
|
||||
</a>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user