File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -65,16 +65,20 @@ class Header extends Component {
6565 dialog . showOpenDialog ( {
6666 defaultPath,
6767 properties : [ 'openFile' , 'openDirectory' , 'multiSelections' ]
68- } ,
69- this . handlePaths )
68+ } )
69+ . then ( this . handlePaths )
70+ . catch ( err => {
71+ this . dialogOpen = false
72+ console . error ( err )
73+ } )
7074 }
7175 }
7276
73- handlePaths ( paths ) {
77+ handlePaths ( { filePaths } ) {
7478 this . dialogOpen = false
75- if ( paths ) {
76- this . emit ( 'config:set' , { paths } )
77- this . emit ( 'library:update-library' , paths )
79+ if ( filePaths ) {
80+ this . emit ( 'config:set' , { filePaths } )
81+ this . emit ( 'library:update-library' , filePaths )
7882 }
7983 }
8084
@@ -86,7 +90,7 @@ class Header extends Component {
8690 event . preventDefault ( )
8791 const { files } = event . dataTransfer
8892 const paths = Array ( files . length ) . fill ( 0 ) . map ( ( _ , i ) => files . item ( i ) . path )
89- this . handlePaths ( paths )
93+ this . handlePaths ( { filePaths : paths } )
9094 }
9195
9296 createElement ( state , emit ) {
You can’t perform that action at this time.
0 commit comments