From 60b51d0648533de1c7eef543004bf5bd5fb93c7c Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 10 Nov 2023 19:52:04 +0800 Subject: [PATCH] Show error toast when file size exceeds the limits (#27985) (#27986) Backport #27985 by @lng2020 As title. Before that, there was no alert at all. After: ![error_toast](https://github.com/go-gitea/gitea/assets/70063547/c54ffeed-76f8-4c3a-b5dc-b9b3e0f8fc76) Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com> --- web_src/js/features/common-global.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js index 2d8289d4e..ba1636b43 100644 --- a/web_src/js/features/common-global.js +++ b/web_src/js/features/common-global.js @@ -248,6 +248,10 @@ export function initGlobalDropzone() { }); } }); + this.on('error', function (file, message) { + showErrorToast(message); + this.removeFile(file); + }); }, }); }