From e07341fa056466f8f3fb51d133a78d127a6dff2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niko=20Vuji=C4=87?= Date: Wed, 31 Dec 2025 10:21:33 +0100 Subject: [PATCH] rule selector saving problems fix --- nodes/xilica-listen.html | 10 ++++++++++ nodes/xilica-subscribe.html | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/nodes/xilica-listen.html b/nodes/xilica-listen.html index bb08c5c..58f364f 100644 --- a/nodes/xilica-listen.html +++ b/nodes/xilica-listen.html @@ -19,6 +19,16 @@ RED.nodes.registerType('xilica-listen', { oneditprepare: function () { var node = this; var rules = node.rules || []; + if (typeof rules === "string") { + try { + rules = JSON.parse(rules); + } catch (e) { + rules = []; + } + } + if (!Array.isArray(rules)) { + rules = []; + } $("#node-input-rules").editableList({ addItem: function (container, index, rule) { diff --git a/nodes/xilica-subscribe.html b/nodes/xilica-subscribe.html index 5ca36e5..7244690 100644 --- a/nodes/xilica-subscribe.html +++ b/nodes/xilica-subscribe.html @@ -22,6 +22,16 @@ RED.nodes.registerType('xilica-subscribe', { oneditprepare: function () { var node = this; var rules = node.rules || []; + if (typeof rules === "string") { + try { + rules = JSON.parse(rules); + } catch (e) { + rules = []; + } + } + if (!Array.isArray(rules)) { + rules = []; + } $("#node-input-rules").editableList({ addItem: function (container, index, rule) {