aboutsummaryrefslogblamecommitdiffstats
path: root/ui/app/pages/first-time-flow/first-time-flow.selectors.js
blob: e6cd5a84ac3b2663ca610652bd4af0fd9fb35078 (plain) (tree)
1
2
3
4
5



                                           
                                       




















                                                        
import {
  INITIALIZE_CREATE_PASSWORD_ROUTE,
  INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE,
  DEFAULT_ROUTE,
} from '../../helpers/constants/routes'

const selectors = {
  getFirstTimeFlowTypeRoute,
}

module.exports = selectors

function getFirstTimeFlowTypeRoute (state) {
  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
}