Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 0463c16

Browse files
committed
use aync await syntax
1 parent 50ddcb9 commit 0463c16

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/views/directory-select.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ export default class DirectorySelect extends React.Component {
4545
);
4646
}
4747

48-
chooseDirectory = () =>
49-
this.props.showOpenDialog(this.props.currentWindow, {
48+
chooseDirectory = async () => {
49+
const {filePaths} = await this.props.showOpenDialog(this.props.currentWindow, {
5050
defaultPath: this.props.buffer.getText(),
5151
properties: ['openDirectory', 'createDirectory', 'promptToCreate'],
52-
}).then(({filePaths}) => {
53-
if (filePaths.length) {
54-
this.props.buffer.setText(filePaths[0]);
55-
}
5652
});
53+
if (filePaths.length) {
54+
this.props.buffer.setText(filePaths[0]);
55+
}
56+
}
5757
}

0 commit comments

Comments
 (0)