mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-03 14:22:19 +02:00
Merge b404d33338
into 549c445853
This commit is contained in:
commit
c563ed483b
|
@ -2,6 +2,7 @@ import {update as updateCursor} from "undate";
|
||||||
|
|
||||||
import socket from "./socket";
|
import socket from "./socket";
|
||||||
import {store} from "./store";
|
import {store} from "./store";
|
||||||
|
import friendlysize from "../js/helpers/friendlysize";
|
||||||
|
|
||||||
class Uploader {
|
class Uploader {
|
||||||
xhr: XMLHttpRequest | null = null;
|
xhr: XMLHttpRequest | null = null;
|
||||||
|
@ -131,8 +132,9 @@ class Uploader {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxFileSize > 0 && file.size > maxFileSize) {
|
if (maxFileSize > 0 && file.size > maxFileSize) {
|
||||||
|
const maxFileSizeHR = friendlysize(maxFileSize);
|
||||||
this.handleResponse({
|
this.handleResponse({
|
||||||
error: `File ${file.name} is over the maximum allowed size`,
|
error: `File "${file.name}" is larger than the maximum allowed size of ${maxFileSizeHR}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue