mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
ui: skip preview if filetoolarge
This commit is contained in:
1 parent
f60741eded
commit
5b2dbc7554
2 files changed
+5
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.26.12",
|
||||
"version": "4.26.13",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
@@ -219,7 +219,10 @@ const page = new NamedPage('problem_files', () => {
|
||||
if (ev) {
|
||||
const link = $(ev.currentTarget).find('a').attr('href');
|
||||
if (!link) return;
|
||||
if (filesize > 8 * 1024 * 1024) Notification.error(i18n('file too large'));
|
||||
if (filesize > 8 * 1024 * 1024) {
|
||||
Notification.error(i18n('file too large'));
|
||||
return;
|
||||
}
|
||||
Notification.info(i18n('Loading file...'));
|
||||
const res = await request.get(link);
|
||||
content = await request.get(res.url, undefined, { dataType: 'text' });
|
||||
|
||||
Reference in new issue
Block a user