fix: withdraw modal
This commit is contained in:
parent
756b544dee
commit
8ab6c3026f
3 changed files with 31 additions and 63 deletions
|
@ -55,7 +55,6 @@ const state = () => {
|
|||
note: null,
|
||||
commitment: null,
|
||||
prefix: null,
|
||||
errors: [],
|
||||
notes: {},
|
||||
statistic: defaultStatistics,
|
||||
ip: {},
|
||||
|
@ -80,12 +79,6 @@ const mutations = {
|
|||
REMOVE_PROOF(state, { note }) {
|
||||
this._vm.$delete(state.notes, note)
|
||||
},
|
||||
SAVE_ERROR(state, message) {
|
||||
state.errors.push(message)
|
||||
},
|
||||
REMOVE_ERRORS(state) {
|
||||
this._vm.$set(state, 'errors', [])
|
||||
},
|
||||
SAVE_LAST_INDEX(state, { nextDepositIndex, anonymitySet, currency, amount }) {
|
||||
const currentState = state.statistic[currency][amount]
|
||||
this._vm.$set(state.statistic[currency], `${amount}`, { ...currentState, nextDepositIndex, anonymitySet })
|
||||
|
@ -765,7 +758,6 @@ const actions = {
|
|||
return { args, proof }
|
||||
},
|
||||
async prepareWithdraw({ dispatch, getters, commit }, { note, recipient }) {
|
||||
commit('REMOVE_ERRORS')
|
||||
commit('REMOVE_PROOF', { note })
|
||||
try {
|
||||
const parsedNote = parseNote(note)
|
||||
|
@ -789,7 +781,7 @@ const actions = {
|
|||
commit('SAVE_PROOF', { proof, args, note })
|
||||
} catch (e) {
|
||||
console.error('prepareWithdraw', e)
|
||||
commit('SAVE_ERROR', e.message)
|
||||
throw new Error(e.message)
|
||||
}
|
||||
},
|
||||
async withdraw({ state, rootState, dispatch, getters }, { note }) {
|
||||
|
@ -951,7 +943,6 @@ const actions = {
|
|||
}
|
||||
} catch (e) {
|
||||
console.error(`Method loadWithdrawalData has error: ${e}`)
|
||||
commit('SAVE_ERROR', e.message)
|
||||
}
|
||||
},
|
||||
calculateEthToReceive({ commit, state, rootGetters }, { currency }) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue