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

20 lines
719 B
JavaScript
Raw Permalink Normal View History

2022-04-22 06:05:56 +03: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 }
})
}
}