Fix attachment row annotation button bug (#3577)

This commit is contained in:
windingwind 2024-01-26 13:51:27 +08:00 committed by GitHub
parent 9151fb3558
commit c21c5632c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -119,8 +119,8 @@ import { getCSSItemTypeIcon } from 'components/icons';
this._attachmentButton.querySelector(".icon").replaceWith(getCSSItemTypeIcon(this._attachment.getItemTypeIconName()));
this._attachmentButton.querySelector(".label").textContent = this._attachment.getField('title');
let annotationCount = this.attachment.isWebAttachment() ? 0 : this.attachment.getAnnotations().length;
this._annotationButton.hidden = annotationCount === 0;
let annotationCount = this.attachment.isFileAttachment() ? this.attachment.getAnnotations().length : 0;
this._annotationButton.hidden = annotationCount == 0;
this._annotationButton.querySelector(".label").textContent = annotationCount;
}
}