diff options
author | Andrew Dolgov <[email protected]> | 2019-03-14 10:20:57 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-03-14 10:20:57 +0300 |
commit | 0f370a8bda8146493bfd3543b3a227bbcbb0d02e (patch) | |
tree | 00f0b8d1f3269e62c95af0b7657b3d72168d8317 | |
parent | a634e78faef035da835635811084bf2d5e8f3fb7 (diff) |
don't open files twice on startup
-rwxr-xr-x | reader.js | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -518,14 +518,8 @@ $(document).ready(function () { const argv = remote.process.argv; if (argv[1] && argv[1] != ".") { - fs.access(argv[1], fs.constants.R_OK, (err) => { - if (err == null) - return model.openFile(argv[1]); - - }); - } - - if (last != null) { + model.openFile(argv[1]); + } else if (last != null) { model.openFile(last); } }); |