Skip to content

Commit

Permalink
Merge pull request #13567 from nextcloud/backport/13504/stable30.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Antreesy authored Oct 17, 2024
2 parents 7eae3b0 + 90e4b38 commit 4672ee0
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 @@ -363,18 +363,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 4672ee0

Please sign in to comment.