Skip to content

Commit

Permalink
fix: use folder icon as fallback
Browse files Browse the repository at this point in the history
Fallback to the folder icon when a content type is missing.

Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb committed Dec 3, 2024
1 parent 6d0a443 commit b9f1a99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/Editor/Attachments/AttachmentsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,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()
Expand Down
4 changes: 3 additions & 1 deletion src/views/EditSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,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) {
Expand Down

0 comments on commit b9f1a99

Please sign in to comment.