Skip to content

Commit

Permalink
Rule edit: Only save rule when opening script if rule changed
Browse files Browse the repository at this point in the history
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 <florianh_dev@icloud.com>
  • Loading branch information
florian-h05 committed Dec 7, 2023
1 parent 617f70b commit 7f08496
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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' : '' })
})
Expand Down

0 comments on commit 7f08496

Please sign in to comment.