diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2020-05-25 17:06:47 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-25 17:06:47 +0300 |
commit | 9e9b2687c739f8e8ee9e580494ab4804287f1680 (patch) | |
tree | d0c8d68cd5b476ce80dd253946cb3cf6ecd02473 | |
parent | 111258fa31bae3d647f3876afdd0dc62b436d9d3 (diff) | |
parent | 3cac305e4b1479303c54fa914b0f8d33d618690b (diff) |
Merge pull request #3667 from nextcloud/backport/3660/stable19
[stable19] Fix file attributes passed to viewer
-rw-r--r-- | src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue index 7f6b9b983..3685e7716 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue @@ -150,55 +150,20 @@ export default { event.stopPropagation() event.preventDefault() - if (this.isMimeTypeOfTextApp(this.mimetype)) { - // The Text app fails to load when not all fileinfo data is given. - // So we have to query the folder to get all the necessary details. - OCA.Viewer.open({ - path: this.internalAbsolutePath, - }) - return - } OCA.Viewer.open({ // Viewer expects an internal absolute path starting with "/". path: this.internalAbsolutePath, list: [ { + fileid: parseInt(this.id, 10), filename: this.internalAbsolutePath, basename: this.name, + mime: this.mimetype, + hasPreview: this.previewAvailable === 'yes', }, ], }) }, - - isMimeTypeOfTextApp(mimetype) { - // keep in sync with https://github.com/nextcloud/text/blob/master/src/helpers/mime.js - return [ - 'text/markdown', - - 'text/plain', - 'application/cmd', - 'application/x-empty', - 'application/x-msdos-program', - 'application/epub+zip', - 'application/javascript', - 'application/json', - 'application/x-perl', - 'application/x-php', - 'application/x-tex', - 'application/xml', - 'application/yaml', - 'text/css', - 'text/csv', - 'text/html', - 'text/x-c', - 'text/x-c++src', - 'text/x-h', - 'text/x-java-source', - 'text/x-ldif', - 'text/x-python', - 'text/x-shellscript', - ].indexOf(mimetype) !== -1 - }, }, } </script> |