File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -23,18 +23,20 @@ const openPdf = new FileAction({
2323 { productName : getCapabilities ( ) . productName } )
2424 } ,
2525
26- enabled : ( files ) => {
27- if ( files . length !== 1 ) {
26+ enabled : ( { nodes } ) => {
27+ if ( nodes . length !== 1 ) {
2828 return false
2929 }
3030
31- const isPdf = files [ 0 ] . mime === 'application/pdf'
31+ const isPdf = nodes [ 0 ] . mime === 'application/pdf'
3232 // Only enable the file action when files_pdfviewer is enabled
3333 const optionalMimetypes = getCapabilities ( ) . mimetypesNoDefaultOpen
3434 return isPdf && optionalMimetypes . includes ( 'application/pdf' )
3535 } ,
3636
37- exec : ( file ) => {
37+ exec : ( { nodes } ) => {
38+ const file = nodes [ 0 ]
39+
3840 // If no viewer API, we can't open the document
3941 if ( ! OCA . Viewer ) {
4042 return
You can’t perform that action at this time.
0 commit comments