mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-14 14:17:46 +00:00
26 lines
649 B
JavaScript
26 lines
649 B
JavaScript
// @flow
|
|
|
|
import { openDialog } from '../base/dialog';
|
|
|
|
import { PremiumFeatureDialog } from './components';
|
|
import { isFeatureDisabled } from './functions';
|
|
|
|
/**
|
|
* Shows a dialog prompting users to upgrade, if requested feature is disabled.
|
|
*
|
|
* @param {string} feature - The feature to check availability for.
|
|
*
|
|
* @returns {Function}
|
|
*/
|
|
export function maybeShowPremiumFeatureDialog(feature: string) {
|
|
return function(dispatch: Function, getState: Function) {
|
|
if (isFeatureDisabled(getState(), feature)) {
|
|
dispatch(openDialog(PremiumFeatureDialog));
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
};
|
|
}
|