File size: 554 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import { useSelector } from 'calypso/state';
import getCurrentQueryArguments from 'calypso/state/selectors/get-current-query-arguments';
import getInitialQueryArguments from 'calypso/state/selectors/get-initial-query-arguments';
import { AppState } from 'calypso/types';

export const startedInHostingFlow = ( state: AppState ) =>
	getInitialQueryArguments( state )?.[ 'hosting-flow' ] === 'true';

export const useIsCurrentlyHostingFlow = () =>
	useSelector(
		( state: AppState ) => getCurrentQueryArguments( state )?.[ 'hosting-flow' ] === 'true'
	);