We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0474aef commit e5ff4a8Copy full SHA for e5ff4a8
src/file-actions.js
@@ -23,10 +23,15 @@ const openPdf = new FileAction({
23
{ productName: getCapabilities().productName })
24
},
25
26
- enabled: () => {
+ enabled: (files) => {
27
+ if (files.length !== 1) {
28
+ return false
29
+ }
30
+
31
+ const isPdf = files[0].mime === 'application/pdf'
32
// Only enable the file action when files_pdfviewer is enabled
33
const optionalMimetypes = getCapabilities().mimetypesNoDefaultOpen
- return optionalMimetypes.includes('application/pdf')
34
+ return isPdf && optionalMimetypes.includes('application/pdf')
35
36
37
exec: (file) => {
0 commit comments