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.
This commit is contained in:
wxiaoguang 2023-08-23 23:15:06 +08:00 committed by GitHub
parent 083b0b4770
commit f67f57a4c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}