diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.spec.js b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.spec.js index d0d8044f31b..64083ac3400 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.spec.js +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.spec.js @@ -348,6 +348,7 @@ describe('FilePreview.vue', () => { availableHandlers: [{ mimes: ['image/png', 'image/jpeg'], }], + mimetypes: ['image/png', 'image/jpeg'], } const wrapper = shallowMount(FilePreview, { @@ -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'], } }) diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue index d2e9defcf47..81167c027ef 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue @@ -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() {