fix file size limit

This commit is contained in:
lendry
2026-07-07 15:42:45 +03:00
parent ca2e30af04
commit 9a0cf54aa6
3 changed files with 29 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ import {
const ANDROID_PLATFORM = 'ANDROID' as const;
const APK_ACCEPT = '.apk,application/vnd.android.package-archive';
const MAX_RELEASE_FILE_BYTES = 350 * 1024 * 1024;
function formatBytes(value: string) {
const size = Number(value);
@@ -83,6 +84,10 @@ export default function AdminReleasesPage() {
showToast('Выберите файл релиза');
return;
}
if (file.size > MAX_RELEASE_FILE_BYTES) {
showToast('APK не должен превышать 350 МБ');
return;
}
const parsedVersionCode = Number(versionCode);
if (!version.trim() || !Number.isInteger(parsedVersionCode) || parsedVersionCode < 1) {
showToast('Укажите версию и положительный код версии');