Skip to content

Commit 3a3cee1

Browse files
committed
feat(neuron-ui): show alert via electron for consistent with the behaviour of mnemonic validation
1 parent 630c6f1 commit 3a3cee1

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • packages/neuron-ui/src/states/stateProvider/actionCreators

packages/neuron-ui/src/states/stateProvider/actionCreators/wallets.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ import {
1010
updateAddressDescription as updateRemoteAddressDescription,
1111
deleteWallet as deleteRemoteWallet,
1212
backupWallet as backupRemoteWallet,
13+
showErrorMessage,
1314
} from 'services/remote'
1415
import initStates from 'states/initStates'
16+
import i18n from 'utils/i18n'
1517
import { wallets as walletsCache, currentWallet as currentWalletCache } from 'utils/localCache'
1618
import { Routes } from 'utils/const'
1719
import addressesToBalance from 'utils/addressesToBalance'
@@ -34,27 +36,27 @@ export const updateCurrentWallet = () => (dispatch: StateDispatch) => {
3436
}
3537

3638
export const createWalletWithMnemonic = (params: Controller.ImportMnemonicParams) => (
37-
dispatch: StateDispatch,
39+
_dispatch: StateDispatch,
3840
history: any
3941
) => {
4042
importMnemonic(params).then(res => {
4143
if (res.status) {
4244
history.push(Routes.Overview)
4345
} else {
44-
addNotification({ type: 'alert', content: res.message.title })(dispatch)
46+
showErrorMessage(i18n.t('error'), i18n.t(res.message.title))
4547
}
4648
})
4749
}
4850

4951
export const importWalletWithMnemonic = (params: Controller.ImportMnemonicParams) => (
50-
dispatch: StateDispatch,
52+
_dispatch: StateDispatch,
5153
history: any
5254
) => {
5355
importMnemonic(params).then(res => {
5456
if (res.status) {
5557
history.push(Routes.Overview)
5658
} else {
57-
addNotification({ type: 'alert', content: res.message.title })(dispatch)
59+
showErrorMessage(i18n.t('error'), i18n.t(res.message.title))
5860
}
5961
})
6062
}

0 commit comments

Comments
 (0)