Add catching error and dispatching FetchRelays
This commit is contained in:
parent
02ea80c756
commit
ab1533028e
1 changed files with 14 additions and 2 deletions
|
@ -51,10 +51,22 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
followRelay() {
|
||||
this.$store.dispatch('AddRelay', this.newRelay)
|
||||
try {
|
||||
this.$store.dispatch('AddRelay', this.newRelay)
|
||||
} catch (_e) {
|
||||
return
|
||||
} finally {
|
||||
this.$store.dispatch('FetchRelays')
|
||||
}
|
||||
},
|
||||
deleteRelay(relay) {
|
||||
this.$store.dispatch('DeleteRelay', relay)
|
||||
try {
|
||||
this.$store.dispatch('DeleteRelay', relay)
|
||||
} catch (_e) {
|
||||
return
|
||||
} finally {
|
||||
this.$store.dispatch('FetchRelays')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue