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.web.ts 1.2KB

123456789101112131415161718192021222324252627282930313233
  1. import { IStore } from '../app/types';
  2. import { isSuboptimalBrowser } from '../base/environment/environment';
  3. import { translateToHTML } from '../base/i18n/functions';
  4. import { showWarningNotification } from '../notifications/actions';
  5. import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
  6. export * from './functions.any';
  7. /**
  8. * Shows the suboptimal experience notification if needed.
  9. *
  10. * @param {Function} dispatch - The dispatch method.
  11. * @param {Function} t - The translation function.
  12. * @returns {void}
  13. */
  14. export function maybeShowSuboptimalExperienceNotification(dispatch: IStore['dispatch'], t: Function) {
  15. if (isSuboptimalBrowser()) {
  16. dispatch(
  17. showWarningNotification(
  18. {
  19. titleKey: 'notify.suboptimalExperienceTitle',
  20. description: translateToHTML(
  21. t,
  22. 'notify.suboptimalBrowserWarning',
  23. {
  24. recommendedBrowserPageLink: `${window.location.origin}/static/recommendedBrowsers.html`
  25. }
  26. )
  27. }, NOTIFICATION_TIMEOUT_TYPE.LONG
  28. )
  29. );
  30. }
  31. }