attachment: fix over reliance on fileType()
Signed-off-by: Yonle <yonle@proton.me>
This commit is contained in:
parent
2ce11e56d4
commit
38444f3165
10 changed files with 41 additions and 63 deletions
|
|
@ -4,6 +4,8 @@ import Attachment from '../attachment/attachment.vue'
|
|||
|
||||
import { useMediaViewerStore } from 'src/stores/media_viewer.js'
|
||||
|
||||
const displayTypes = ["image", "video", "flash"]
|
||||
|
||||
const Gallery = {
|
||||
props: [
|
||||
'attachments',
|
||||
|
|
@ -45,20 +47,14 @@ const Gallery = {
|
|||
: attachments
|
||||
.reduce(
|
||||
(acc, attachment, i) => {
|
||||
if (attachment.mimetype.includes('audio')) {
|
||||
if (attachment.type == 'audio') {
|
||||
return [
|
||||
...acc,
|
||||
{ audio: true, items: [attachment] },
|
||||
{ items: [] },
|
||||
]
|
||||
}
|
||||
if (
|
||||
!(
|
||||
attachment.mimetype.includes('image') ||
|
||||
attachment.mimetype.includes('video') ||
|
||||
attachment.mimetype.includes('flash')
|
||||
)
|
||||
) {
|
||||
if (!displayTypes.includes(attachment.type)) {
|
||||
return [
|
||||
...acc,
|
||||
{ minimal: true, items: [attachment] },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue