From 0e949d45af72d9a4281da5a5f75f697de23a7690 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 25 Jul 2025 19:09:56 +0800 Subject: [PATCH] Apply suggestion Signed-off-by: wxiaoguang --- web_src/js/features/repo-issue.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web_src/js/features/repo-issue.ts b/web_src/js/features/repo-issue.ts index 3cc7f99e23c..0947d2ce0ef 100644 --- a/web_src/js/features/repo-issue.ts +++ b/web_src/js/features/repo-issue.ts @@ -543,9 +543,9 @@ function initIssueTemplateCommentEditors(commentForm: HTMLFormElement) { showElem(commentForm.querySelectorAll('.combo-editor-dropzone .form-field-real')); hideElem(commentForm.querySelectorAll('.combo-editor-dropzone .combo-markdown-editor')); queryElems(commentForm, '.combo-editor-dropzone .form-field-dropzone', (dropzoneContainer) => { - const dropzoneEl = dropzoneContainer.closest('.combo-editor-dropzone').querySelector('.dropzone'); - const dzInstance = dropzoneEl?.dropzone; - const hasUploadedFiles = Boolean(dzInstance?.files.length); + // if "form-field-dropzone" exists, then "dropzone" must also exist + const dropzone = dropzoneContainer.querySelector('.dropzone').dropzone; + const hasUploadedFiles = dropzone.files.length !== 0; toggleElem(dropzoneContainer, hasUploadedFiles); });