clean up preferences-page

This commit is contained in:
Mathias Rasmussen
2018-09-28 17:10:21 +02:00
parent caceeee238
commit f231c54886
2 changed files with 8 additions and 8 deletions

View File

@@ -1,3 +1,5 @@
const path = require('path')
const colors = require('material-ui/styles/colors')
const electron = require('electron')
const React = require('react')
@@ -31,8 +33,8 @@ class PathSelector extends React.Component {
handleClick () {
const opts = Object.assign({
defaultPath: this.props.value,
properties: ['openFile', 'openDirectory']
defaultPath: this.props.value && path.dirname(this.props.value),
properties: [ 'openFile', 'openDirectory' ]
}, this.props.dialog)
remote.dialog.showOpenDialog(