Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/neuron-ui/src/states/initStates/wallet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { addresses, currentWallet } from 'services/localCache'

export const emptyWallet: State.Wallet = {
name: '',
id: '',
balance: '0',
addresses: [],
}

const wallet = currentWallet.load()

export const walletState: State.Wallet = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
backupWallet as backupRemoteWallet,
showErrorMessage,
} from 'services/remote'
import initStates from 'states/initStates'
import { emptyWallet } from 'states/initStates/wallet'
import { WalletWizardPath } from 'components/WalletWizard'
import i18n from 'utils/i18n'
import { wallets as walletsCache, currentWallet as currentWalletCache } from 'services/localCache'
Expand All @@ -26,7 +26,7 @@ import { addNotification, addPopup } from './app'
export const updateCurrentWallet = () => (dispatch: StateDispatch, history: any) => {
getCurrentWallet().then(res => {
if (res.status === 1) {
const payload = res.result || initStates.wallet
const payload = res.result || emptyWallet
if (!payload || !payload.id) {
history.push(`${Routes.WalletWizard}${WalletWizardPath.Welcome}`)
}
Expand Down