mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-04 05:43:57 +00:00
default safe logic fixes
This commit is contained in:
parent
ca51768b04
commit
f2f9cb7d81
@ -7,6 +7,7 @@ import { LOAD_ADDRESS, OPEN_ADDRESS, SAFELIST_ADDRESS, SAFE_PARAM_ADDRESS, WELCO
|
||||
import Loader from 'src/components/Loader'
|
||||
import { defaultSafeSelector } from 'src/routes/safe/store/selectors'
|
||||
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'))
|
||||
|
||||
@ -44,7 +45,7 @@ const Routes = ({ location }) => {
|
||||
return <Redirect to={WELCOME_ADDRESS} />
|
||||
}
|
||||
|
||||
if (typeof defaultSafe === 'undefined') {
|
||||
if (defaultSafe === DEFAULT_SAFE_INITIAL_STATE) {
|
||||
return <Loader />
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@ import makeSafe from 'src/routes/safe/store/models/safe'
|
||||
import { checksumAddress } from 'src/utils/checksumAddress'
|
||||
|
||||
export const SAFE_REDUCER_ID = 'safes'
|
||||
export const DEFAULT_SAFE_INITIAL_STATE = 'NOT_ASKED'
|
||||
|
||||
export const buildSafe = (storedSafe) => {
|
||||
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),
|
||||
},
|
||||
Map({
|
||||
// $FlowFixMe
|
||||
defaultSafe: undefined,
|
||||
defaultSafe: DEFAULT_SAFE_INITIAL_STATE,
|
||||
safes: Map(),
|
||||
// $FlowFixMe
|
||||
latestMasterContractVersion: '',
|
||||
}),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user