Skip to content

Commit

Permalink
feat(neuron-ui): navigate to the Overview view on wallet switching
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Aug 2, 2019
1 parent c0a20bd commit bea4b20
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions packages/neuron-ui/src/states/stateProvider/actionCreators/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ import {
} from 'utils/localCache'

export const initAppState = () => (dispatch: StateDispatch, history: any) => {
dispatch({
type: AppActions.UpdateLoadings,
payload: {
addressList: true,
transactionList: true,
},
})
getNeuronWalletState()
.then(res => {
if (res.status) {
Expand Down Expand Up @@ -49,6 +42,8 @@ export const initAppState = () => (dispatch: StateDispatch, history: any) => {
})
if (!wallet) {
history.push(`${Routes.WalletWizard}${WalletWizardPath.Welcome}`)
} else {
history.push(Routes.Overview)
}

currentWalletCache.save(wallet)
Expand All @@ -63,15 +58,6 @@ export const initAppState = () => (dispatch: StateDispatch, history: any) => {
.catch(() => {
history.push(`${Routes.WalletWizard}${WalletWizardPath.Welcome}`)
})
.finally(() => {
dispatch({
type: AppActions.UpdateLoadings,
payload: {
addressList: false,
transactionList: false,
},
})
})
}

export const addPopup = (text: string) => (dispatch: StateDispatch) => {
Expand Down

0 comments on commit bea4b20

Please sign in to comment.