diff --git a/src/nodes/ImageView.vue b/src/nodes/ImageView.vue index 25b7d5e32c..50860bea64 100644 --- a/src/nodes/ImageView.vue +++ b/src/nodes/ImageView.vue @@ -175,7 +175,6 @@ export default { showIcons: false, imageUrl: null, errorMessage: null, - attachmentType: null, attachmentSize: null, showImageModal: false, imageIndex: null, @@ -187,8 +186,15 @@ export default { ...mapGetters({ imageAttachments: 'text/imageAttachments', }), + attachmentType() { + if (this.attachment) { + return this.attachment.isImage ? 'image' : 'media' + } else { + return null + } + }, isMediaAttachment() { - return this.attachmentType === this.$attachmentResolver.ATTACHMENT_TYPE_MEDIA + return this.attachmentType === 'media' }, showDeleteIcon() { return this.isEditable && this.showIcons @@ -241,7 +247,6 @@ export default { this.imageUrl = this.attachment.previewUrl this.imageLoaded = true this.loaded = true - this.attachmentType = this.attachment.isImage ? this.$attachmentResolver.ATTACHMENT_TYPE_IMAGE : this.$attachmentResolver.ATTACHMENT_TYPE_MEDIA this.attachmentSize = this.attachment.size } img.onerror = (e) => { diff --git a/src/services/AttachmentResolver.js b/src/services/AttachmentResolver.js index 51b57b69be..1f99caef39 100644 --- a/src/services/AttachmentResolver.js +++ b/src/services/AttachmentResolver.js @@ -37,9 +37,6 @@ export default class AttachmentResolver { #documentId #initAttachmentListPromise - ATTACHMENT_TYPE_IMAGE = 'image' - ATTACHMENT_TYPE_MEDIA = 'media' - constructor({ session, user, shareToken, currentDirectory, fileId }) { this.#session = session this.#user = user