2022-11-10 08:45:56 +00:00
|
|
|
import { IStore } from '../app/types';
|
|
|
|
import { isSuboptimalBrowser } from '../base/environment/environment';
|
|
|
|
import { translateToHTML } from '../base/i18n/functions';
|
|
|
|
import { showWarningNotification } from '../notifications/actions';
|
|
|
|
import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
|
2020-09-30 11:50:39 +00:00
|
|
|
|
2020-10-08 09:41:00 +00:00
|
|
|
export * from './functions.any';
|
|
|
|
|
2020-09-30 11:50:39 +00:00
|
|
|
/**
|
|
|
|
* Shows the suboptimal experience notification if needed.
|
|
|
|
*
|
|
|
|
* @param {Function} dispatch - The dispatch method.
|
|
|
|
* @param {Function} t - The translation function.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2022-11-10 08:45:56 +00:00
|
|
|
export function maybeShowSuboptimalExperienceNotification(dispatch: IStore['dispatch'], t: Function) {
|
2020-09-30 11:50:39 +00:00
|
|
|
if (isSuboptimalBrowser()) {
|
|
|
|
dispatch(
|
|
|
|
showWarningNotification(
|
|
|
|
{
|
|
|
|
titleKey: 'notify.suboptimalExperienceTitle',
|
|
|
|
description: translateToHTML(
|
|
|
|
t,
|
|
|
|
'notify.suboptimalBrowserWarning',
|
|
|
|
{
|
|
|
|
recommendedBrowserPageLink: `${window.location.origin}/static/recommendedBrowsers.html`
|
|
|
|
}
|
|
|
|
)
|
2021-11-24 11:05:27 +00:00
|
|
|
}, NOTIFICATION_TIMEOUT_TYPE.LONG
|
2020-09-30 11:50:39 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|