Skip to content

Commit

Permalink
Fix dirty warning shown on delete (#2470)
Browse files Browse the repository at this point in the history
Fixes #2462.

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 authored Mar 12, 2024
1 parent 9f006fd commit c41aa38
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ export default {
'Delete persistence configuration',
() => {
this.$oh.api.delete('/rest/persistence/' + this.serviceId).then(() => {
this.dirty = false
this.$f7router.back({ force: true })
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ export default {
'Delete Rule',
() => {
this.$oh.api.delete('/rest/rules/' + this.rule.uid).then(() => {
this.dirty = false
this.$f7router.back('/settings/rules/', { force: true })
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ export default {
'Delete Scene',
() => {
this.$oh.api.delete('/rest/rules/' + this.rule.uid).then(() => {
this.dirty = false
this.$f7router.back('/settings/scenes/', { force: true })
})
}
Expand Down Expand Up @@ -441,7 +442,6 @@ export default {
this.$set(this.rule, section, newSection)
},
buildActionModules () {
const currentItemNames = this.rule.actions.map((a) => a.configuration.itemName)
const modulesToRemove = this.rule.actions.filter((a) => this.selectedItems.indexOf(a.configuration.itemName) < 0)
if (modulesToRemove.length > 0) console.debug('Removing: ' + modulesToRemove.map((m) => m.configuration.itemName).join(', '))
this.$set(this.rule, 'actions', this.rule.actions.filter((a) => this.selectedItems.indexOf(a.configuration.itemName) >= 0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ export default {
'Delete ' + (this.isScriptRule ? 'Script' : 'Rule'),
() => {
this.$oh.api.delete('/rest/rules/' + this.rule.uid).then(() => {
this.dirty = false
this.$f7router.back('/settings/scripts/', { force: true })
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ export default {
'Delete Thing',
() => {
this.$oh.api.delete(url).then(() => {
this.dirty = false
this.$f7router.back('/settings/things/', { force: true })
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ export default {
'Delete Transformation',
() => {
this.$oh.api.delete('/rest/transformations/' + this.transformation.uid).then(() => {
this.dirty = false
this.$f7router.back('/settings/transformations/', { force: true })
})
}
Expand Down

0 comments on commit c41aa38

Please sign in to comment.