classic-ui/modules/account/store/actions/saveAccount.js
Danil Kovtonyuk 44f31f8b9f
init
2022-04-22 13:14:19 +10:00

20 lines
421 B
JavaScript

export function saveAccount({ dispatch, rootState }, { account, address, backup }) {
const { ethAccount } = rootState.metamask
dispatch('createMutation', {
type: 'SET_ENCRYPTED_ACCOUNT',
payload: account
})
dispatch('createMutation', {
type: 'SET_ADDRESSES',
payload: {
addresses: {
encrypt: address,
backup: backup || '-',
connect: ethAccount
}
}
})
}