From 631415280e97c634f22932d750e120eed7b12656 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Sun, 14 Feb 2016 20:03:25 +0900 Subject: [PATCH] Fix window state restoration not working --- src/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index 8df87f72..c071f3fe 100644 --- a/src/main.js +++ b/src/main.js @@ -111,10 +111,10 @@ app.on('ready', function() { } // Create the browser window. - var bounds_info_path = app.getPath("userData") + "/bounds-info.json"; + var bounds_info_path = path.resolve(app.getPath("userData"), "bounds-info.json"); var window_options; try { - window_options = require(bounds_info_path); + window_options = JSON.parse(fs.readFileSync(bounds_info_path, 'utf-8')); } catch (e) { // follow Electron's defaults