You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
852 B
36 lines
852 B
6 years ago
|
import {
|
||
|
INITIALIZE_CREATE_PASSWORD_ROUTE,
|
||
|
INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE,
|
||
|
DEFAULT_ROUTE,
|
||
4 years ago
|
} from '../helpers/constants/routes';
|
||
6 years ago
|
|
||
4 years ago
|
export function getFirstTimeFlowTypeRoute(state) {
|
||
4 years ago
|
const { firstTimeFlowType } = state.metamask;
|
||
6 years ago
|
|
||
4 years ago
|
let nextRoute;
|
||
6 years ago
|
if (firstTimeFlowType === 'create') {
|
||
4 years ago
|
nextRoute = INITIALIZE_CREATE_PASSWORD_ROUTE;
|
||
6 years ago
|
} else if (firstTimeFlowType === 'import') {
|
||
4 years ago
|
nextRoute = INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE;
|
||
6 years ago
|
} else {
|
||
4 years ago
|
nextRoute = DEFAULT_ROUTE;
|
||
6 years ago
|
}
|
||
|
|
||
4 years ago
|
return nextRoute;
|
||
6 years ago
|
}
|
||
5 years ago
|
|
||
5 years ago
|
export const getOnboardingInitiator = (state) => {
|
||
4 years ago
|
const { onboardingTabs } = state.metamask;
|
||
5 years ago
|
|
||
|
if (!onboardingTabs || Object.keys(onboardingTabs).length !== 1) {
|
||
4 years ago
|
return null;
|
||
5 years ago
|
}
|
||
|
|
||
4 years ago
|
const location = Object.keys(onboardingTabs)[0];
|
||
|
const tabId = onboardingTabs[location];
|
||
5 years ago
|
return {
|
||
|
location,
|
||
|
tabId,
|
||
4 years ago
|
};
|
||
|
};
|