Skip to content

Commit

Permalink
fix: Limit open with Collabora action to pdf files
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Knorr <jus@bitgrid.net>

[skip ci]
  • Loading branch information
juliusknorr authored and backportbot[bot] committed Nov 15, 2024
1 parent 3332164 commit f8cd59c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/file-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ const openPdf = new FileAction({
{ productName: richdocuments.productName })
},

enabled: () => {
enabled: (files) => {
if (files.length !== 1) {
return false
}

const isPdf = files[0].mime === 'application/pdf'
// Only enable the file action when files_pdfviewer is enabled
const optionalMimetypes = richdocuments.mimetypesNoDefaultOpen
return optionalMimetypes.includes('application/pdf')
Expand Down

0 comments on commit f8cd59c

Please sign in to comment.