aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-08-23 23:15:06 +0800
committerGitHub <noreply@github.com>2023-08-23 23:15:06 +0800
commitf67f57a4c28d1660dec6cadb7fd07bdeda98aa5b (patch)
tree7c5686a52a23b9582c5da329e8fd5ce811fbb21a /web_src
parent083b0b4770b275a8ff4eb4114dd9997863a24950 (diff)
downloadgitea-f67f57a4c28d1660dec6cadb7fd07bdeda98aa5b.tar.gz
gitea-f67f57a4c28d1660dec6cadb7fd07bdeda98aa5b.zip
Handle "comment form combo editor init" more gracefully (#26688)
Now Gitea exposes unhandled promise rejection messages as error message on the UI. The "comment form" was quite unclear before, so it should be handled more gracefully to avoid such error.
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/repo-legacy.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/web_src/js/features/repo-legacy.js b/web_src/js/features/repo-legacy.js
index 5991df6322..3b25c36538 100644
--- a/web_src/js/features/repo-legacy.js
+++ b/web_src/js/features/repo-legacy.js
@@ -54,9 +54,10 @@ export function initRepoCommentForm() {
}
if ($commentForm.find('.field.combo-editor-dropzone').length) {
- // at the moment, if a form has multiple combo-markdown-editors, it must be a issue template form
+ // at the moment, if a form has multiple combo-markdown-editors, it must be an issue template form
initIssueTemplateCommentEditors($commentForm);
- } else {
+ } else if ($commentForm.find('.combo-markdown-editor').length) {
+ // it's quite unclear about the "comment form" elements, sometimes it's for issue comment, sometimes it's for file editor/uploader message
initSingleCommentEditor($commentForm);
}