diff options
author | Andrew Dolgov <[email protected]> | 2019-03-14 10:16:35 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-03-14 10:16:35 +0300 |
commit | a634e78faef035da835635811084bf2d5e8f3fb7 (patch) | |
tree | f11866d50984d7cec55ae39a15c1b97b6537d614 | |
parent | ba0a081321083b4b111916939dcfe1af99911bab (diff) |
add recent document in MRU method
-rwxr-xr-x | app.js | 1 | ||||
-rwxr-xr-x | reader.js | 5 |
2 files changed, 4 insertions, 2 deletions
@@ -17,7 +17,6 @@ function openFileDialog() { }); if (result && result[0]) { - app.addRecentDocument(result[0]); mainWindow.webContents.send("open-file", result[0]); } } @@ -176,9 +176,12 @@ function Model() { write: function (file) { self.mruList().splice(5); - if (self._mruList().length == 0 || self._mruList()[self._mruList().length - 1] != file) + if (self._mruList().length == 0 || self._mruList()[self._mruList().length - 1] != file) { self._mruList.push(file); + require('electron').remote.app.addRecentDocument(file); + } + localforage.setItem("MRU-LIST", self._mruList()); } }); |