diff --git a/packages/node_modules/@node-red/editor-client/src/js/settings.js b/packages/node_modules/@node-red/editor-client/src/js/settings.js
index c4a164fbe..e360cea7d 100644
--- a/packages/node_modules/@node-red/editor-client/src/js/settings.js
+++ b/packages/node_modules/@node-red/editor-client/src/js/settings.js
@@ -37,7 +37,7 @@ RED.settings = (function () {
if (key === "auth-tokens") {
localStorage.setItem(key, JSON.stringify(value));
} else {
- userSettings[key] = value;
+ RED.utils.setMessageProperty(userSettings,key,value);
saveUserSettings();
}
};
@@ -46,16 +46,25 @@ RED.settings = (function () {
* If the key is not set in the localStorage it returns undefined
* Else return the JSON parsed value
* @param key
+ * @param defaultIfUndefined
* @returns {*}
*/
- var get = function (key) {
+ var get = function (key,defaultIfUndefined) {
if (!hasLocalStorage()) {
return undefined;
}
if (key === "auth-tokens") {
return JSON.parse(localStorage.getItem(key));
} else {
- return userSettings[key];
+ try {
+ var v = RED.utils.getMessageProperty(userSettings,key);
+ if (v === undefined) {
+ v = defaultIfUndefined;
+ }
+ } catch(err) {
+ v = defaultIfUndefined;
+ }
+ return v;
}
};
diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js
index 038caac4a..0cc78dc5c 100644
--- a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js
+++ b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js
@@ -722,6 +722,62 @@ RED.utils = (function() {
return result;
}
+ function setMessageProperty(msg,prop,value,createMissing) {
+ if (typeof createMissing === 'undefined') {
+ createMissing = (typeof value !== 'undefined');
+ }
+ if (prop.indexOf('msg.')===0) {
+ prop = prop.substring(4);
+ }
+ var msgPropParts = normalisePropertyExpression(prop);
+ var depth = 0;
+ var length = msgPropParts.length;
+ var obj = msg;
+ var key;
+ for (var i=0;i