Skip to content

Commit 754b97d

Browse files
committed
Fix file loading regressions
1 parent c225e7c commit 754b97d

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

renderer/player/elements/header/index.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)