default safe logic fixes

This commit is contained in:
Mikhail Mikheev 2020-06-26 18:38:59 +04:00
parent ca51768b04
commit f2f9cb7d81
2 changed files with 4 additions and 4 deletions

View File

@ -7,6 +7,7 @@ import { LOAD_ADDRESS, OPEN_ADDRESS, SAFELIST_ADDRESS, SAFE_PARAM_ADDRESS, WELCO
import Loader from 'src/components/Loader' import Loader from 'src/components/Loader'
import { defaultSafeSelector } from 'src/routes/safe/store/selectors' import { defaultSafeSelector } from 'src/routes/safe/store/selectors'
import { useAnalytics } from 'src/utils/googleAnalytics' import { useAnalytics } from 'src/utils/googleAnalytics'
import { DEFAULT_SAFE_INITIAL_STATE } from 'src/routes/safe/store/reducer/safe'
const Welcome = React.lazy(() => import('./welcome/container')) const Welcome = React.lazy(() => import('./welcome/container'))
@ -44,7 +45,7 @@ const Routes = ({ location }) => {
return <Redirect to={WELCOME_ADDRESS} /> return <Redirect to={WELCOME_ADDRESS} />
} }
if (typeof defaultSafe === 'undefined') { if (defaultSafe === DEFAULT_SAFE_INITIAL_STATE) {
return <Loader /> return <Loader />
} }

View File

@ -16,6 +16,7 @@ import makeSafe from 'src/routes/safe/store/models/safe'
import { checksumAddress } from 'src/utils/checksumAddress' import { checksumAddress } from 'src/utils/checksumAddress'
export const SAFE_REDUCER_ID = 'safes' export const SAFE_REDUCER_ID = 'safes'
export const DEFAULT_SAFE_INITIAL_STATE = 'NOT_ASKED'
export const buildSafe = (storedSafe) => { export const buildSafe = (storedSafe) => {
const names = storedSafe.owners.map((owner) => owner.name) const names = storedSafe.owners.map((owner) => owner.name)
@ -125,10 +126,8 @@ export default handleActions(
[SET_LATEST_MASTER_CONTRACT_VERSION]: (state, action) => state.set('latestMasterContractVersion', action.payload), [SET_LATEST_MASTER_CONTRACT_VERSION]: (state, action) => state.set('latestMasterContractVersion', action.payload),
}, },
Map({ Map({
// $FlowFixMe defaultSafe: DEFAULT_SAFE_INITIAL_STATE,
defaultSafe: undefined,
safes: Map(), safes: Map(),
// $FlowFixMe
latestMasterContractVersion: '', latestMasterContractVersion: '',
}), }),
) )