classic-ui-dev/modules/account/store/actions/removeAccount.js

20 lines
719 B
JavaScript
Raw Normal View History

2022-04-21 23:05:56 -04:00
export function removeAccount({ dispatch }) {
try {
dispatch('createMutation', { type: 'SET_DOMAIN_REQUEST', payload: { key: 'removeAccount' } })
dispatch('createMutation', { type: 'REMOVE_ADDRESSES' })
dispatch('createMutation', { type: 'REMOVE_KEY' })
dispatch('createMutation', { type: 'ENABLED_SAVE_FILE', payload: { isEnabled: true } })
dispatch('createMutation', { type: 'REMOVE_STATISTIC' })
this.$sessionStorage.clear()
dispatch('createMutation', { type: 'SET_DOMAIN_SUCCESS', payload: { key: 'removeAccount' } })
} catch (err) {
dispatch('createMutation', {
type: 'SET_DOMAIN_FAILED',
payload: { key: 'removeAccount', errorMessage: err.message }
})
}
}