Skip to content

Commit 0e949d4

Browse files
authored
Apply suggestion
Signed-off-by: wxiaoguang <[email protected]>
1 parent c606832 commit 0e949d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

web_src/js/features/repo-issue.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,9 @@ function initIssueTemplateCommentEditors(commentForm: HTMLFormElement) {
543543
showElem(commentForm.querySelectorAll('.combo-editor-dropzone .form-field-real'));
544544
hideElem(commentForm.querySelectorAll('.combo-editor-dropzone .combo-markdown-editor'));
545545
queryElems(commentForm, '.combo-editor-dropzone .form-field-dropzone', (dropzoneContainer) => {
546-
const dropzoneEl = dropzoneContainer.closest<HTMLElement>('.combo-editor-dropzone').querySelector<HTMLElement>('.dropzone');
547-
const dzInstance = dropzoneEl?.dropzone;
548-
const hasUploadedFiles = Boolean(dzInstance?.files.length);
546+
// if "form-field-dropzone" exists, then "dropzone" must also exist
547+
const dropzone = dropzoneContainer.querySelector('.dropzone').dropzone;
548+
const hasUploadedFiles = dropzone.files.length !== 0;
549549
toggleElem(dropzoneContainer, hasUploadedFiles);
550550
});
551551

0 commit comments

Comments
 (0)