From 0afa1839ff7f219df3487fa64f8e015f84ac7f3e Mon Sep 17 00:00:00 2001 From: bordun Date: Mon, 19 Oct 2020 08:21:14 +0200 Subject: [PATCH] widget: update prop cache sequentially to avoid multi-prop edition from causing errors (eg: address & preArgs at the same time => cache error because the old value is needed by the manager) --- CHANGELOG.md | 5 +++++ src/client/widgets/common/widget.js | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 437328a0..c433e05f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.5.3 + +- bug fixes + - editor: error when `preArgs` and `address` are modified at the same time (affects `/EDIT` command and matrix/clone widgets) + ## 1.5.2 - bug fixes diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index fd79d36b..bb5f9de1 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -730,8 +730,7 @@ class Widget extends EventEmitter { } else { - this.cachedProps[propName] = propValue - changedProps.push({propName, oldPropValue}) + changedProps.push({propName, propValue, oldPropValue}) } @@ -745,13 +744,11 @@ class Widget extends EventEmitter { } - if (options && options.fromEditor) { - this.checkLinkedProps(propNames) - } if (changedProps.length) { for (var i in changedProps) { + this.cachedProps[changedProps[i].propName] = changedProps[i].propValue this.onPropChanged(changedProps[i].propName, options, changedProps[i].oldPropValue) } @@ -764,6 +761,10 @@ class Widget extends EventEmitter { } + if (options && options.fromEditor) { + this.checkLinkedProps(propNames) + } + } onPropChanged(propName, options={}, oldPropValue) {