From a099e7bf7409bb4d4222cc62fc23d06861c30c00 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Fri, 29 Nov 2024 15:39:10 +0100 Subject: [PATCH] fix: use folder icon as fallback Fallback to the folder icon when a content type is missing. Signed-off-by: Daniel Kesselberg --- src/components/Editor/Attachments/AttachmentsList.vue | 4 +++- src/views/EditSidebar.vue | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Editor/Attachments/AttachmentsList.vue b/src/components/Editor/Attachments/AttachmentsList.vue index 0fb8a97146..56d1dacd38 100644 --- a/src/components/Editor/Attachments/AttachmentsList.vue +++ b/src/components/Editor/Attachments/AttachmentsList.vue @@ -220,7 +220,9 @@ export default { if (attachment.xNcHasPreview) { return generateUrl(`/core/preview?fileId=${attachment.xNcFileId}&x=100&y=100&a=0`) } - return attachment.formatType ? OC.MimeType.getIconUrl(attachment.formatType) : null + return attachment.formatType + ? OC.MimeType.getIconUrl(attachment.formatType) + : OC.MimeType.getIconUrl('folder') }, getBaseName(name) { return name.split('/').pop() diff --git a/src/views/EditSidebar.vue b/src/views/EditSidebar.vue index 185cfe5a67..7f25171789 100644 --- a/src/views/EditSidebar.vue +++ b/src/views/EditSidebar.vue @@ -516,7 +516,9 @@ export default { if (attachment.xNcHasPreview) { return generateUrl(`/core/preview?fileId=${attachment.xNcFileId}&x=100&y=100&a=0`) } - return attachment.formatType ? OC.MimeType.getIconUrl(attachment.formatType) : null + return attachment.formatType + ? OC.MimeType.getIconUrl(attachment.formatType) + : OC.MimeType.getIconUrl('folder') }, acceptAttachmentsModal() { if (!this.doNotShare) {