Fix deprecated dialog callback functions

This commit is contained in:
hicom150
2019-11-23 00:03:20 +01:00
parent af8b9cf1f2
commit d738021285
4 changed files with 35 additions and 35 deletions

View File

@@ -36,14 +36,9 @@ class PathSelector extends React.Component {
properties: ['openFile', 'openDirectory']
}, this.props.dialog)
remote.dialog.showOpenDialog(
remote.getCurrentWindow(),
opts,
(filenames) => {
if (!Array.isArray(filenames)) return
this.props.onChange && this.props.onChange(filenames[0])
}
)
const filenames = remote.dialog.showOpenDialogSync(remote.getCurrentWindow(), opts)
if (!Array.isArray(filenames)) return
this.props.onChange && this.props.onChange(filenames[0])
}
render () {