|
|
@ -6,7 +6,6 @@ import { |
|
|
|
LOCK_ROUTE, |
|
|
|
LOCK_ROUTE, |
|
|
|
INITIALIZE_WELCOME_ROUTE, |
|
|
|
INITIALIZE_WELCOME_ROUTE, |
|
|
|
INITIALIZE_UNLOCK_ROUTE, |
|
|
|
INITIALIZE_UNLOCK_ROUTE, |
|
|
|
INITIALIZE_METAMETRICS_OPT_IN_ROUTE, |
|
|
|
|
|
|
|
} from '../../../helpers/constants/routes' |
|
|
|
} from '../../../helpers/constants/routes' |
|
|
|
|
|
|
|
|
|
|
|
export default class FirstTimeFlowSwitch extends PureComponent { |
|
|
|
export default class FirstTimeFlowSwitch extends PureComponent { |
|
|
@ -14,16 +13,10 @@ export default class FirstTimeFlowSwitch extends PureComponent { |
|
|
|
completedOnboarding: PropTypes.bool, |
|
|
|
completedOnboarding: PropTypes.bool, |
|
|
|
isInitialized: PropTypes.bool, |
|
|
|
isInitialized: PropTypes.bool, |
|
|
|
isUnlocked: PropTypes.bool, |
|
|
|
isUnlocked: PropTypes.bool, |
|
|
|
optInMetaMetrics: PropTypes.bool, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
const { |
|
|
|
const { completedOnboarding, isInitialized, isUnlocked } = this.props |
|
|
|
completedOnboarding, |
|
|
|
|
|
|
|
isInitialized, |
|
|
|
|
|
|
|
isUnlocked, |
|
|
|
|
|
|
|
optInMetaMetrics, |
|
|
|
|
|
|
|
} = this.props |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (completedOnboarding) { |
|
|
|
if (completedOnboarding) { |
|
|
|
return <Redirect to={{ pathname: DEFAULT_ROUTE }} /> |
|
|
|
return <Redirect to={{ pathname: DEFAULT_ROUTE }} /> |
|
|
@ -37,14 +30,6 @@ export default class FirstTimeFlowSwitch extends PureComponent { |
|
|
|
return <Redirect to={{ pathname: INITIALIZE_WELCOME_ROUTE }} /> |
|
|
|
return <Redirect to={{ pathname: INITIALIZE_WELCOME_ROUTE }} /> |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!isUnlocked) { |
|
|
|
return <Redirect to={{ pathname: INITIALIZE_UNLOCK_ROUTE }} /> |
|
|
|
return <Redirect to={{ pathname: INITIALIZE_UNLOCK_ROUTE }} /> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (optInMetaMetrics === null) { |
|
|
|
|
|
|
|
return <Redirect to={{ pathname: INITIALIZE_WELCOME_ROUTE }} /> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return <Redirect to={{ pathname: INITIALIZE_METAMETRICS_OPT_IN_ROUTE }} /> |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|