Skip to content

Commit

Permalink
fix #161 by adjusting openFileDialog call to match new Electron
Browse files Browse the repository at this point in the history
  • Loading branch information
todbot committed Nov 4, 2021
1 parent ccc3d36 commit 5a85c3d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/components/gui/scriptForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,12 @@ var ScriptForm = React.createClass({
}
this.props.onSave(this.state);
},
openFileDialog: function() {
openFileDialog: async function() {
var self = this;
dialog.showOpenDialog(function (filenames) {
if (filenames === undefined) { return; }
var filename = filenames[0];
self.setState({path: filename});
});
const result = await dialog.showOpenDialog();
if( result.filePaths[0] ) {
self.setState({path: result.filePaths[0]});
}
},
handleActionType: function(e) {
var actionType = e.target.value;
Expand Down

0 comments on commit 5a85c3d

Please sign in to comment.