Improve readability of maximum upload size error

This commit is contained in:
Brett Gilio 2022-12-23 01:11:29 +00:00
parent 073a38ef1e
commit f22a5082b0

View file

@ -116,6 +116,7 @@ class Uploader {
const wasQueueEmpty = this.fileQueue.length === 0;
const maxFileSize = store.state.serverConfiguration?.fileUploadMaxFileSize || 0;
const maxFileSizeInMB = (maxFileSize / 1024 / 1024).toFixed(0);
for (const file of files) {
if (!file) {
@ -124,7 +125,7 @@ class Uploader {
if (maxFileSize > 0 && file.size > maxFileSize) {
this.handleResponse({
error: `File ${file.name} is over the maximum allowed size`,
error: `File "${file.name}" is larger than the maximum allowed size of ${maxFileSizeInMB} MB.`,
});
continue;