Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
fix: do not wait until the transaction response to close modal (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-a-m-l authored and faustbrian committed Nov 17, 2018
1 parent c7cab49 commit 95e1ea3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/renderer/components/Transaction/TransactionModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,21 @@ export default {
},
async onConfirm () {
// Produce the messages before closing the modal to avoid `$t` scope errors
const success = this.$t(`TRANSACTION.SUCCESS.${this.transactionKey}`)
const error = this.$t(`TRANSACTION.ERROR.${this.transactionKey}`)
this.emitSent()
const response = await this.$client.broadcastTransaction(this.transaction)
this.isSuccessfulResponse(response)
? this.$success(this.$t(`TRANSACTION.SUCCESS.${this.transactionKey}`))
: this.$error(this.$t(`TRANSACTION.ERROR.${this.transactionKey}`))
this.emitSent(response)
? this.$success(success)
: this.$error(error)
},
emitSent (response) {
this.$emit('sent', response)
emitSent () {
this.$emit('sent')
},
emitCancel () {
Expand Down

0 comments on commit 95e1ea3

Please sign in to comment.