Add catching error and dispatching FetchRelays

This commit is contained in:
Angelina Filippova 2019-10-23 21:02:21 +02:00
parent 02ea80c756
commit ab1533028e

View file

@ -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')
}
}
}
}