Skip to content

Commit

Permalink
Change name of action, since the same name is used in wallet method (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinbodnar committed May 18, 2020
1 parent bf7f1f1 commit 53bee9b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/actions/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { push } from 'connected-react-router'
import { loadState, saveState, clearState } from '../utils/sessionStorage'
import { WALLET_CREATE_NEW_ACCOUNT_URL, WALLET_CREATE_NEW_ACCOUNT_FLOW_URLS, WALLET_LOGIN_URL } from '../utils/wallet'

export const loadAccount = createAction('LOAD_ACCOUNT',
export const refreshAccountExternal = createAction('REFRESH_ACCOUNT_EXTERNAL',
accountId => wallet.getAccount(accountId).state(),
accountId => ({ accountId })
)
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/allAccounts.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect } from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { LOADING, NOT_FOUND } from '../reducers/allAccounts'
import { loadAccount } from '../actions/account'
import { refreshAccountExternal } from '../actions/account'

export { LOADING, NOT_FOUND }

Expand All @@ -14,7 +14,7 @@ export function useAccount(accountId) {
const dispatch = useDispatch()

useEffect(() => {
if (account.__status === LOADING) dispatch(loadAccount(accountId))
if (account.__status === LOADING) dispatch(refreshAccountExternal(accountId))
}, [accountId])

return account
Expand Down
4 changes: 2 additions & 2 deletions src/reducers/allAccounts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { handleAction } from 'redux-actions'
import { loadAccount } from '../actions/account'
import { refreshAccountExternal } from '../actions/account'

export const LOADED = Symbol('LOADED')
export const LOADING = Symbol('LOADING')
Expand Down Expand Up @@ -27,4 +27,4 @@ const reducer = (state, event) => {
}
}

export default handleAction(loadAccount, reducer, initialState)
export default handleAction(refreshAccountExternal, reducer, initialState)

0 comments on commit 53bee9b

Please sign in to comment.