Still fallback to old attachment display method if needed

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-12-29 16:36:34 +01:00
parent e095302750
commit 32b2823538

View File

@@ -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
}
if (attachment.extendedData.fileid) {
window.location = generateUrl('/f/' + attachment.extendedData.fileid)
return
}
window.location = generateUrl(`/apps/deck/cards/${attachment.cardId}/attachment/${attachment.id}`)
},
},
}