Skip to content

Commit

Permalink
Fix rule creation (#999)
Browse files Browse the repository at this point in the history
Fixes #998.

Signed-off-by: Yannick Schaus <github@schaus.net>
  • Loading branch information
ghys authored Apr 11, 2021
1 parent 93d9dd3 commit 0bcbd8c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,14 @@ export default {
? this.$oh.api.postPlain('/rest/rules', JSON.stringify(this.rule), 'text/plain', 'application/json')
: this.$oh.api.put('/rest/rules/' + this.rule.uid, this.rule)
return promise.then((data) => {
this.dirty = false
if (this.createMode) {
this.$f7.toast.create({
text: 'Rule created',
destroyOnClose: true,
closeTimeout: 2000
}).open()
this.$f7router.navigate(this.$f7route.url.replace('/add', '/' + this.rule.uid), { reloadCurrent: true })
this.$f7router.navigate(this.$f7route.url.replace('/add', '/' + this.rule.uid).replace('/schedule/', '/rules/'), { reloadCurrent: true })
this.load()
} else {
this.$f7.toast.create({
Expand All @@ -337,7 +338,6 @@ export default {
}).open()
this.savedRule = cloneDeep(this.rule)
}
this.dirty = false
// if (!stay) this.$f7router.back()
}).catch((err) => {
this.$f7.toast.create({
Expand Down

0 comments on commit 0bcbd8c

Please sign in to comment.