1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Ensure keyboard shortcuts get saved in runtime settings

Fixes #1696
This commit is contained in:
Nick O'Leary 2018-04-15 11:43:03 +01:00
parent 838c7a5e89
commit 64ae67586a
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 2 additions and 2 deletions

View File

@ -389,6 +389,7 @@ RED.keyboard = (function() {
var currentEditorSettings = RED.settings.get('editor') || {};
var userKeymap = currentEditorSettings.keymap || {};
userKeymap[object.id] = null;
currentEditorSettings.keymap = userKeymap;
RED.settings.set('editor',currentEditorSettings);
var obj = {
@ -442,6 +443,7 @@ RED.keyboard = (function() {
var currentEditorSettings = RED.settings.get('editor') || {};
var userKeymap = currentEditorSettings.keymap || {};
userKeymap[object.id] = RED.keyboard.getShortcut(object.id);
currentEditorSettings.keymap = userKeymap;
RED.settings.set('editor',currentEditorSettings);
}
}

View File

@ -81,8 +81,6 @@ module.exports = {
writeFile: function(path,content,backupPath) {
if (backupPath) {
try {
console.log(path);
console.log(backupPath);
fs.renameSync(path,backupPath);
} catch(err) {
console.log(err);