mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-14 16:47:46 +00:00
* feat(dialog): Adds name to all dialogs. The name is used for debugging purposes to be added to logs. * squash: Drop empty string.
26 lines
852 B
TypeScript
26 lines
852 B
TypeScript
import { IStore } from '../app/types';
|
|
import { openDialog } from '../base/dialog/actions';
|
|
import { ParticipantFeaturesKey } from '../base/participants/types';
|
|
|
|
import PremiumFeatureDialog from './components/web/PremiumFeatureDialog';
|
|
import { isFeatureDisabled } from './functions';
|
|
|
|
/**
|
|
* Shows a dialog prompting users to upgrade, if requested feature is disabled.
|
|
*
|
|
* @param {ParticipantFeaturesKey} feature - The feature to check availability for.
|
|
*
|
|
* @returns {Function}
|
|
*/
|
|
export function maybeShowPremiumFeatureDialog(feature: ParticipantFeaturesKey) {
|
|
return function(dispatch: IStore['dispatch'], getState: IStore['getState']) {
|
|
if (isFeatureDisabled(getState(), feature)) {
|
|
dispatch(openDialog('PremiumFeatureDialog', PremiumFeatureDialog));
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
};
|
|
}
|