2022-06-16 09:49:07 +00:00
|
|
|
import { WELCOME_PAGE_ENABLED } from '../base/flags/constants';
|
|
|
|
import { getFeatureFlag } from '../base/flags/functions';
|
|
|
|
import { toState } from '../base/redux/functions';
|
2017-09-01 04:13:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2022-06-16 09:49:07 +00:00
|
|
|
* Determines whether the {@code WelcomePage} is enabled.
|
2017-09-01 04:13:59 +00:00
|
|
|
*
|
2018-05-10 04:45:24 +00:00
|
|
|
* @param {Function|Object} stateful - The redux state or {@link getState}
|
|
|
|
* function.
|
2022-06-16 09:49:07 +00:00
|
|
|
* @returns {boolean} If the {@code WelcomePage} is enabled by the app, then
|
2017-10-01 06:35:19 +00:00
|
|
|
* {@code true}; otherwise, {@code false}.
|
2017-09-01 04:13:59 +00:00
|
|
|
*/
|
2022-06-16 09:49:07 +00:00
|
|
|
export function isWelcomePageEnabled(stateful: Function | Object) {
|
|
|
|
if (navigator.product === 'ReactNative') {
|
|
|
|
return getFeatureFlag(stateful, WELCOME_PAGE_ENABLED, false);
|
|
|
|
}
|
2021-11-11 14:32:56 +00:00
|
|
|
|
2022-06-16 09:49:07 +00:00
|
|
|
return toState(stateful)['features/base/config'].enableWelcomePage;
|
|
|
|
}
|