You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { getName } from '../app';
  2. import { translateToHTML } from '../base/i18n';
  3. import { RTCBrowserType } from '../base/lib-jitsi-meet';
  4. import { showWarningNotification } from '../notifications';
  5. /**
  6. * Shows the suboptimal experience notification if needed.
  7. *
  8. * @param {Function} dispatch - The dispatch method.
  9. * @param {Function} t - The translation function.
  10. * @returns {void}
  11. */
  12. export function maybeShowSuboptimalExperienceNotification(dispatch, t) {
  13. if (!RTCBrowserType.isChrome()
  14. && !RTCBrowserType.isFirefox()
  15. && !RTCBrowserType.isNWJS()
  16. && !RTCBrowserType.isElectron()
  17. // Adding react native to the list of recommended browsers is not
  18. // necessary for now because the function won't be executed at all
  19. // in this case but I'm adding it for completeness.
  20. && !RTCBrowserType.isReactNative()
  21. ) {
  22. dispatch(
  23. showWarningNotification(
  24. {
  25. titleKey: 'notify.suboptimalExperienceTitle',
  26. description: translateToHTML(
  27. t,
  28. 'notify.suboptimalExperienceDescription',
  29. {
  30. appName: getName()
  31. })
  32. }
  33. )
  34. );
  35. }
  36. }