diff options
author | Phie <phie@phie.ovh> | 2020-05-01 00:20:45 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2020-05-01 00:20:45 +0300 |
commit | 682b6679921e6b32415f76d36f95b539390fcff4 (patch) | |
tree | 5a6cb70d72f1d64d2c101adfb7a9a0e05b16491a /settings | |
parent | 17ed4d5b4d4295fc1e70309cc8978d3f51206786 (diff) |
fix change note path on electron
Diffstat (limited to 'settings')
-rw-r--r-- | settings/settings.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/settings/settings.js b/settings/settings.js index 7b2830d..550cde5 100644 --- a/settings/settings.js +++ b/settings/settings.js @@ -10,15 +10,16 @@ $(document).ready(function () { var dialog = remote.dialog; dialog.showOpenDialog({ properties: ['openDirectory'] - }, function (path) { - if (path != undefined) { + }).then(result => { + if (!result.canceled && result.filePaths != undefined) { RequestBuilder.sRequestBuilder.post("/settings/note_path", { - path: path + path: result.filePaths }, function (error, data) { window.location.reload(true) }); } - + }).catch(err => { + console.log(err) }) } else { var newPath = window.prompt("Please enter a new path. Be aware that this won't move your notes, so be careful", currentPath); |