Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

actions.web.ts 727B

123456789101112131415161718192021222324
  1. import { IStore } from '../app/types';
  2. import { openDialog } from '../base/dialog/actions';
  3. import PremiumFeatureDialog from './components/web/PremiumFeatureDialog';
  4. import { isFeatureDisabled } from './functions';
  5. /**
  6. * Shows a dialog prompting users to upgrade, if requested feature is disabled.
  7. *
  8. * @param {string} feature - The feature to check availability for.
  9. *
  10. * @returns {Function}
  11. */
  12. export function maybeShowPremiumFeatureDialog(feature: string) {
  13. return function(dispatch: IStore['dispatch'], getState: IStore['getState']) {
  14. if (isFeatureDisabled(getState(), feature)) {
  15. dispatch(openDialog(PremiumFeatureDialog));
  16. return true;
  17. }
  18. return false;
  19. };
  20. }