Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

functions.js 1.9KB

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