Skip to content

Commit

Permalink
Merge pull request #13566 from nextcloud/backport/13504/stable30
Browse files Browse the repository at this point in the history
  • Loading branch information
Antreesy authored Oct 17, 2024
2 parents 776b0f5 + deae3f1 commit 7c4c1f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ describe('FilePreview.vue', () => {
availableHandlers: [{
mimes: ['image/png', 'image/jpeg'],
}],
mimetypes: ['image/png', 'image/jpeg'],
}

const wrapper = shallowMount(FilePreview, {
Expand Down Expand Up @@ -423,6 +424,7 @@ describe('FilePreview.vue', () => {
availableHandlers: [{
mimes: ['video/mp4', 'image/jpeg', 'image/png', 'image/gif'],
}],
mimetypes: ['video/mp4', 'image/jpeg', 'image/png', 'image/gif'],
}
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,18 +375,7 @@ export default {
},

isViewerAvailable() {
if (!OCA.Viewer) {
return false
}

const availableHandlers = OCA.Viewer.availableHandlers
for (let i = 0; i < availableHandlers.length; i++) {
if (availableHandlers[i]?.mimes?.includes && availableHandlers[i].mimes.includes(this.file.mimetype)) {
return true
}
}

return false
return OCA.Viewer?.mimetypes?.includes(this.file.mimetype)
},

isVoiceMessage() {
Expand Down

0 comments on commit 7c4c1f1

Please sign in to comment.