From 7f0849699f7e7333597b978455e991f8a1eef409 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Thu, 7 Dec 2023 22:26:27 +0100 Subject: [PATCH] Rule edit: Only save rule when opening script if rule changed Fixes #2027. When a script inside a rule was opened, the UI always saved the rule before navigating to the script editor. With this fix, the rule is only saved if there is a change to save. If the rule hasn't been changed, no save request is performed. Signed-off-by: Florian Hotze --- .../org.openhab.ui/web/src/pages/settings/rules/rule-edit.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/rules/rule-edit.vue b/bundles/org.openhab.ui/web/src/pages/settings/rules/rule-edit.vue index d5c76e581a..db59918abf 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/rules/rule-edit.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/rules/rule-edit.vue @@ -674,7 +674,7 @@ export default { this.currentModuleType = mod.type this.scriptCode = mod.configuration.script - const updatePromise = (this.rule.editable || this.isNewRule) ? this.save() : Promise.resolve() + const updatePromise = (this.rule.editable || this.isNewRule) && this.dirty ? this.save() : Promise.resolve() updatePromise.then(() => { this.$f7router.navigate('/settings/rules/' + this.rule.uid + '/script/' + mod.id, { transition: this.$theme.aurora ? 'f7-cover-v' : '' }) })