2019-03-05 16:45:01 +01:00
|
|
|
import {
|
|
|
|
INITIALIZE_CREATE_PASSWORD_ROUTE,
|
|
|
|
INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE,
|
|
|
|
DEFAULT_ROUTE,
|
2020-05-04 17:22:34 +02:00
|
|
|
} from '../helpers/constants/routes'
|
2019-03-05 16:45:01 +01:00
|
|
|
|
2020-01-09 04:34:58 +01:00
|
|
|
export function getFirstTimeFlowTypeRoute (state) {
|
2019-03-05 16:45:01 +01:00
|
|
|
const { firstTimeFlowType } = state.metamask
|
|
|
|
|
|
|
|
let nextRoute
|
|
|
|
if (firstTimeFlowType === 'create') {
|
|
|
|
nextRoute = INITIALIZE_CREATE_PASSWORD_ROUTE
|
|
|
|
} else if (firstTimeFlowType === 'import') {
|
|
|
|
nextRoute = INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE
|
|
|
|
} else {
|
|
|
|
nextRoute = DEFAULT_ROUTE
|
|
|
|
}
|
|
|
|
|
|
|
|
return nextRoute
|
|
|
|
}
|
2019-11-22 18:03:51 +01:00
|
|
|
|
2020-01-09 04:34:58 +01:00
|
|
|
export const getOnboardingInitiator = (state) => {
|
2019-11-22 18:03:51 +01:00
|
|
|
const { onboardingTabs } = state.metamask
|
|
|
|
|
|
|
|
if (!onboardingTabs || Object.keys(onboardingTabs).length !== 1) {
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
|
|
|
|
const location = Object.keys(onboardingTabs)[0]
|
|
|
|
const tabId = onboardingTabs[location]
|
|
|
|
return {
|
|
|
|
location,
|
|
|
|
tabId,
|
|
|
|
}
|
|
|
|
}
|