diff options
-rw-r--r-- | .vscode/launch.json | 8 | ||||
-rw-r--r-- | reader.js | 11 |
2 files changed, 14 insertions, 5 deletions
diff --git a/.vscode/launch.json b/.vscode/launch.json index 80a93e0..0edf4d8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,11 +7,17 @@ "request": "launch", "cwd": "${workspaceFolder}", "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron", + "runtimeArgs": [ + ".", + "--enable-logging" + ], "windows": { "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd" }, "args" : ["."], - "outputCapture": "std" + "outputCapture": "std", + "sourceMaps": false, + "stopOnEntry": false, } ] } @@ -305,17 +305,20 @@ function Model() { const { remote } = require('electron'); const { dialog } = remote; - const result = dialog.showOpenDialog(remote.getCurrentWindow(), + dialog.showOpenDialog(remote.getCurrentWindow(), { properties: ['openFile'], filters: [ { name: 'Comic Archives', extensions: ['cbz', 'zip'] } ], + }).then((result) => { + console.log('openFileDialog result', result); + + if (result && result.filePaths && result.filePaths[0]) { + self.openFile(result.filePaths[0]); + } }); - if (result && result[0]) { - self.openFile(result[0]); - } }; self._updateMruMenu = ko.computed(function() { |