Warn users if a file is too large to upload

This commit is contained in:
2021-09-27 12:04:39 +02:00
parent 3c478720c9
commit 85a4ca2c9d
4 changed files with 24 additions and 5 deletions

View File

@@ -78,6 +78,17 @@ const on_failure = (status, message) => {
}
export const start = () => {
if (window.user_subscription.file_size_limit === 0) {
window.user_subscription.file_size_limit = 5e9
}
if (job.total_size > window.user_subscription.file_size_limit) {
on_failure(
"file_too_large",
"This file is too large. Check out the Pro subscription to increase the file size limit"
)
return
}
start_time = new Date().getTime()
if (stats_interval === null) {
stats_interval = setInterval(on_progress, stats_interval_ms)

View File

@@ -83,7 +83,7 @@ const keydown = e => {
left: 50%;
transform: translate(-50%, -20%);
padding: 0;
border-radius: 16px 16px 8px 8px;
border-radius: 20px 20px 8px 8px;
overflow: hidden;
box-sizing: border-box;
text-align: left;