mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 04:17:23 +00:00
fix
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import React from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { i18nContext } from "../utils/i18n";
|
||||
import { i18nData } from "../i18n.ts";
|
||||
|
||||
export default function showPopup(
|
||||
content: React.ReactNode,
|
||||
@@ -43,7 +45,9 @@ export default function showPopup(
|
||||
document.body.appendChild(mask);
|
||||
|
||||
createRoot(div).render(
|
||||
<context.Provider value={close}>{content}</context.Provider>,
|
||||
<context.Provider value={close}>
|
||||
<i18nContext.Provider value={i18nData}>{content}</i18nContext.Provider>
|
||||
</context.Provider>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -686,6 +686,7 @@ function fileSizeToString(size: number) {
|
||||
|
||||
function FileTile({ file }: { file: RFile }) {
|
||||
const buttonRef = createRef<HTMLButtonElement>();
|
||||
const buttonRef2 = createRef<HTMLButtonElement>();
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -774,13 +775,14 @@ function FileTile({ file }: { file: RFile }) {
|
||||
<div className="flex flex-row-reverse xs:hidden p-2">
|
||||
{file.size > 10 * 1024 * 1024 ? (
|
||||
<button
|
||||
ref={buttonRef2}
|
||||
className={"btn btn-primary btn-soft btn-sm"}
|
||||
onClick={() => {
|
||||
if (!app.cloudflareTurnstileSiteKey) {
|
||||
const link = network.getFileDownloadLink(file.id, "");
|
||||
window.open(link, "_blank");
|
||||
} else {
|
||||
showPopup(<CloudflarePopup file={file} />, buttonRef.current!);
|
||||
showPopup(<CloudflarePopup file={file} />, buttonRef2.current!);
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
Reference in New Issue
Block a user