fix: withdraw modal

This commit is contained in:
Danil Kovtonyuk 2022-07-05 20:33:29 +10:00
parent 756b544dee
commit 8ab6c3026f
No known key found for this signature in database
GPG key ID: E72A919BF08C3746
3 changed files with 31 additions and 63 deletions

View file

@ -5,7 +5,7 @@
<button type="button" class="delete" @click="$emit('close')" />
</header>
<div class="note" data-test="withdrawal_confirmation_text">
{{ message }}
{{ $t('yourZkSnarkProofHasBeenSuccesfullyGenerated') }}
</div>
<b-button type="is-primary is-fullwidth" data-test="withdrawal_confirm_button" @click="_sendWithdraw">
{{ $t('confirm') }}
@ -14,7 +14,6 @@
</template>
<script>
/* eslint-disable no-console */
import { mapState } from 'vuex'
export default {
props: {
@ -27,13 +26,7 @@ export default {
required: true
}
},
data() {
return {
message: ''
}
},
computed: {
...mapState('application', ['notes', 'errors']),
withdrawalMethod() {
if (this.withdrawType === 'wallet') {
return 'application/withdraw'
@ -42,24 +35,6 @@ export default {
return 'relayer/relayTornadoWithdraw'
}
},
watch: {
notes(newNotes) {
if (newNotes[this.note]) {
this.$store.dispatch('loading/disable')
this.message = this.$t('yourZkSnarkProofHasBeenSuccesfullyGenerated')
}
},
errors: {
handler(type) {
this.$store.dispatch('loading/disable')
this.$parent.close()
},
deep: true
}
},
beforeCreate() {
this.$store.dispatch('loading/enable', { message: this.$t('generatingProof') })
},
methods: {
async _sendWithdraw() {
this.$store.dispatch('loading/enable', { message: this.$t('preparingTransactionData') })