aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNanguan Lin <70063547+lng2020@users.noreply.github.com>2023-11-10 19:43:18 +0800
committerGitHub <noreply@github.com>2023-11-10 19:43:18 +0800
commit6c9e196e5457b30716f3939f258dca07567a2637 (patch)
tree0fb92b35b5c7fd81b7d42d1ca666723064194148
parent481e738e7f3ee22a5a8280d155a1b7d1ff09bc7f (diff)
downloadgitea-6c9e196e5457b30716f3939f258dca07567a2637.tar.gz
gitea-6c9e196e5457b30716f3939f258dca07567a2637.zip
Show error toast when file size exceeds the limits (#27985)
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)
-rw-r--r--web_src/js/features/common-global.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js
index c00c06c0cc..c2e0111849 100644
--- a/web_src/js/features/common-global.js
+++ b/web_src/js/features/common-global.js
@@ -247,6 +247,10 @@ export function initGlobalDropzone() {
});
}
});
+ this.on('error', function (file, message) {
+ showErrorToast(message);
+ this.removeFile(file);
+ });
},
});
}