From ec93cd9ea4e160d5ba6d6908f7e28c5c692b5484 Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Fri, 6 Apr 2018 21:10:32 +0300 Subject: [PATCH] fix dialog --- src/app/config-page.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/config-page.js b/src/app/config-page.js index dcec990..e805577 100644 --- a/src/app/config-page.js +++ b/src/app/config-page.js @@ -7,6 +7,10 @@ import TextField from 'material-ui/TextField' import Slider from 'material-ui/Slider' import fs from 'fs' +let dialog +if(typeof WEB === 'undefined') + dialog = require('electron').remote.dialog + export default class ConfigPage extends Page { constructor(props) { super(props) @@ -121,6 +125,8 @@ export default class ConfigPage extends Page { }} /> { + if(!dialog) + return const dir = dialog.showOpenDialog({properties: ['openDirectory']})[0] if(dir) { @@ -144,6 +150,8 @@ export default class ConfigPage extends Page { }} /> { + if(!dialog) + return const dir = dialog.showOpenDialog({properties: ['openDirectory']})[0] if(dir) {