mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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
@@ -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