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

Avoid writing unchanged settings

This commit is contained in:
Nick O'Leary 2014-10-03 14:47:23 +01:00
parent 86d4179039
commit c223e7f58f

View File

@ -16,6 +16,8 @@
var when = require("when");
var assert = require("assert");
var userSettings = null;
var globalSettings = null;
var storage = null;
@ -59,7 +61,13 @@ var persistentSettings = {
throw new Error("Settings not available");
}
globalSettings[prop] = value;
return storage.saveSettings(globalSettings);
var current = persistentSettings.get(prop);
try {
assert.deepEqual(current,value);
return when.resolve();
} catch(err) {
return storage.saveSettings(globalSettings);
}
},
available: function() {