attachment: fix over reliance on fileType()

Signed-off-by: Yonle <yonle@proton.me>
This commit is contained in:
Yonle 2026-02-27 04:12:47 +07:00
commit 38444f3165
No known key found for this signature in database
GPG key ID: 11889F326F523287
10 changed files with 41 additions and 63 deletions

View file

@ -1,7 +1,5 @@
import { defineStore } from 'pinia'
import fileTypeService from '../services/file_type/file_type.service.js'
const supportedTypes = new Set(['image', 'video', 'audio', 'flash'])
export const useMediaViewerStore = defineStore('mediaViewer', {
@ -13,8 +11,7 @@ export const useMediaViewerStore = defineStore('mediaViewer', {
actions: {
setMedia(attachments) {
const media = attachments.filter((attachment) => {
const type = fileTypeService.fileType(attachment.mimetype)
return supportedTypes.has(type)
return supportedTypes.has(attachment.type)
})
this.media = media