Skip to content

Commit 8ffe90b

Browse files
fracadoprintminion-co
authored andcommitted
IONOS: feat(Viewer): remove collabora documents from preview
Signed-off-by: Franziska Bath <franziska.bath@strato.de>
1 parent e21af8d commit 8ffe90b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/views/Viewer.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,16 @@ export default defineComponent({
739739
740740
let filteredFiles
741741
if (configModule.alwaysShowViewer) {
742-
// only include files with mime to exclude directories, otherwise accept all mimes
743-
filteredFiles = fileList.filter(file => file?.mime)
742+
// only include files with mime to exclude directories
743+
// and office documents/pdfs to exclude collabora files
744+
// otherwise accept all mimes
745+
filteredFiles = fileList.filter(file => {
746+
const mime = file?.mime;
747+
const isOfficeDocument = mime && OC.MimeTypeList.aliases[mime]?.startsWith('x-office');
748+
const isPdf = mime && mime === 'application/pdf';
749+
750+
return mime && !isOfficeDocument && !isPdf;
751+
})
744752
} else {
745753
// filter out the unwanted mimes
746754
filteredFiles = fileList.filter(file => file.mime && mimes.indexOf(file.mime) !== -1)

0 commit comments

Comments
 (0)