From 32b2823538ef0cfe9f6346efc32b225e256ac46f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 29 Dec 2020 16:36:34 +0100 Subject: [PATCH] Still fallback to old attachment display method if needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/card/AttachmentList.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/card/AttachmentList.vue b/src/components/card/AttachmentList.vue index b49b90804..0910bc3a2 100644 --- a/src/components/card/AttachmentList.vue +++ b/src/components/card/AttachmentList.vue @@ -218,11 +218,17 @@ export default { this.$refs.localAttachments.click() }, showViewer(attachment) { - if (window.OCA.Viewer.availableHandlers.map(handler => handler.mimes).flat().includes(attachment.extendedData.mimetype)) { + if (attachment.extendedData.fileid && window.OCA.Viewer.availableHandlers.map(handler => handler.mimes).flat().includes(attachment.extendedData.mimetype)) { window.OCA.Viewer.open(attachment.extendedData.path) return } - window.location = generateUrl('/f/' + attachment.extendedData.fileid) + + if (attachment.extendedData.fileid) { + window.location = generateUrl('/f/' + attachment.extendedData.fileid) + return + } + + window.location = generateUrl(`/apps/deck/cards/${attachment.cardId}/attachment/${attachment.id}`) }, }, }