Skip to content

Commit

Permalink
feat(neuron-ui): show alert via electron for consistent with the beha…
Browse files Browse the repository at this point in the history
…viour of mnemonic validation
  • Loading branch information
Keith-CY committed Aug 1, 2019
1 parent 630c6f1 commit 3a3cee1
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ import {
updateAddressDescription as updateRemoteAddressDescription,
deleteWallet as deleteRemoteWallet,
backupWallet as backupRemoteWallet,
showErrorMessage,
} from 'services/remote'
import initStates from 'states/initStates'
import i18n from 'utils/i18n'
import { wallets as walletsCache, currentWallet as currentWalletCache } from 'utils/localCache'
import { Routes } from 'utils/const'
import addressesToBalance from 'utils/addressesToBalance'
Expand All @@ -34,27 +36,27 @@ export const updateCurrentWallet = () => (dispatch: StateDispatch) => {
}

export const createWalletWithMnemonic = (params: Controller.ImportMnemonicParams) => (
dispatch: StateDispatch,
_dispatch: StateDispatch,
history: any
) => {
importMnemonic(params).then(res => {
if (res.status) {
history.push(Routes.Overview)
} else {
addNotification({ type: 'alert', content: res.message.title })(dispatch)
showErrorMessage(i18n.t('error'), i18n.t(res.message.title))
}
})
}

export const importWalletWithMnemonic = (params: Controller.ImportMnemonicParams) => (
dispatch: StateDispatch,
_dispatch: StateDispatch,
history: any
) => {
importMnemonic(params).then(res => {
if (res.status) {
history.push(Routes.Overview)
} else {
addNotification({ type: 'alert', content: res.message.title })(dispatch)
showErrorMessage(i18n.t('error'), i18n.t(res.message.title))
}
})
}
Expand Down

0 comments on commit 3a3cee1

Please sign in to comment.