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.
2 parents 5f742b6 + f59e23b commit 11d40b0Copy full SHA for 11d40b0
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