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