Skip to content

Commit f67f57a

Browse files
authored
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.
1 parent 083b0b4 commit f67f57a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web_src/js/features/repo-legacy.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ export function initRepoCommentForm() {
5454
}
5555

5656
if ($commentForm.find('.field.combo-editor-dropzone').length) {
57-
// at the moment, if a form has multiple combo-markdown-editors, it must be a issue template form
57+
// at the moment, if a form has multiple combo-markdown-editors, it must be an issue template form
5858
initIssueTemplateCommentEditors($commentForm);
59-
} else {
59+
} else if ($commentForm.find('.combo-markdown-editor').length) {
60+
// it's quite unclear about the "comment form" elements, sometimes it's for issue comment, sometimes it's for file editor/uploader message
6061
initSingleCommentEditor($commentForm);
6162
}
6263

0 commit comments

Comments
 (0)