Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

functions.js 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // @flow
  2. import { getAppProp } from '../base/app';
  3. import { toState } from '../base/redux';
  4. declare var APP: Object;
  5. declare var config: Object;
  6. export * from './roomnameGenerator';
  7. /**
  8. * Determines whether the {@code WelcomePage} is enabled by the app itself
  9. * (e.g. programmatically via the Jitsi Meet SDK for Android and iOS). Not to be
  10. * confused with {@link isWelcomePageUserEnabled}.
  11. *
  12. * @param {Function|Object} stateful - The redux state or {@link getState}
  13. * function.
  14. * @returns {boolean} If the {@code WelcomePage} is enabled by the app, then
  15. * {@code true}; otherwise, {@code false}.
  16. */
  17. export function isWelcomePageAppEnabled(stateful: Function | Object) {
  18. if (navigator.product === 'ReactNative') {
  19. // We introduced the welcomePageEnabled prop on App in Jitsi Meet SDK
  20. // for Android and iOS. There isn't a strong reason not to introduce it
  21. // on Web but there're a few considerations to be taken before I go
  22. // there among which:
  23. // - Enabling/disabling the Welcome page on Web historically
  24. // automatically redirects to a random room and that does not make sense
  25. // on mobile (right now).
  26. return Boolean(getAppProp(stateful, 'welcomePageEnabled'));
  27. }
  28. return true;
  29. }
  30. /**
  31. * Determines whether the {@code WelcomePage} is enabled by the user either
  32. * herself or through her deployment config(uration). Not to be confused with
  33. * {@link isWelcomePageAppEnabled}.
  34. *
  35. * @param {Function|Object} stateful - The redux state or {@link getState}
  36. * function.
  37. * @returns {boolean} If the {@code WelcomePage} is enabled by the user, then
  38. * {@code true}; otherwise, {@code false}.
  39. */
  40. export function isWelcomePageUserEnabled(stateful: Function | Object) {
  41. return (
  42. typeof APP === 'undefined'
  43. ? true
  44. : toState(stateful)['features/base/config'].enableWelcomePage);
  45. }