mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-06 13:58:05 +03:00
client: increase import file size limit to 8MB (#1254)
* client: increase import file size limit to 8MB * fix: if >8e6 is invalid, then valid should be <=8e6
This commit is contained in:
@@ -35,7 +35,7 @@ export default function ImportFileInfo({
|
||||
|
||||
const [errMsg, setErrMsg] = useState<string | null>("");
|
||||
const [data, setData] = useState<ParseFunctionReturn | null>(null);
|
||||
const valid = useMemo(() => errMsg === null && file && file.size < 4e6, [errMsg]);
|
||||
const valid = useMemo(() => errMsg === null && file && file.size <= 8e6, [errMsg]);
|
||||
|
||||
const [moreInfo, setMoreInfo] = useState<Record<string, string>>({});
|
||||
const [moreInfoFulfilled, setMoreInfoFulfilled] = useState(!MoreDataForm);
|
||||
@@ -67,7 +67,7 @@ export default function ImportFileInfo({
|
||||
return null;
|
||||
}
|
||||
|
||||
const isTooLarge = file.size > 4e6;
|
||||
const isTooLarge = file.size > 8e6;
|
||||
|
||||
if (!data || !file) {
|
||||
return null;
|
||||
@@ -87,7 +87,7 @@ export default function ImportFileInfo({
|
||||
<span className={isTooLarge ? "text-danger" : ""}>
|
||||
{prettyBytes(file.size)}
|
||||
{isTooLarge
|
||||
? " (File too large, Can't be larger than 4MB. Sorry!)"
|
||||
? " (File too large, Can't be larger than 8MB. Sorry!)"
|
||||
: ""}
|
||||
</span>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user