indexOf instead of includes to avoid a polyfill
This commit is contained in:
parent
6a56467515
commit
1326cc3249
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -300,7 +300,7 @@ var mailgoInit = function mailgoInit() {
|
|||
var _ref = i18n,
|
||||
translations = _ref.translations; // if a default language is defined use it
|
||||
|
||||
if (((_config = config) === null || _config === void 0 ? void 0 : _config.lang) && i18n.languages.includes(config.lang)) {
|
||||
if (((_config = config) === null || _config === void 0 ? void 0 : _config.lang) && i18n.languages.indexOf(config.lang) !== -1) {
|
||||
lang = config.lang;
|
||||
} // if is defined <html lang=""> use it!
|
||||
|
||||
|
@ -309,7 +309,7 @@ var mailgoInit = function mailgoInit() {
|
|||
// keep the lang from html
|
||||
var htmlLang = document.documentElement.lang; // if there are translations...
|
||||
|
||||
if (i18n.languages.includes(htmlLang)) {
|
||||
if (i18n.languages.indexOf(htmlLang) !== -1) {
|
||||
lang = document.documentElement.lang;
|
||||
}
|
||||
} // strings
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -93,7 +93,7 @@ const mailgoInit = (): void => {
|
|||
}: { translations: MailgoTranslations } = i18n as MailgoI18n;
|
||||
|
||||
// if a default language is defined use it
|
||||
if (config?.lang && i18n.languages.includes(config.lang)) {
|
||||
if (config?.lang && i18n.languages.indexOf(config.lang) !== -1) {
|
||||
lang = config.lang;
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ const mailgoInit = (): void => {
|
|||
let htmlLang: string = document.documentElement.lang;
|
||||
|
||||
// if there are translations...
|
||||
if (i18n.languages.includes(htmlLang)) {
|
||||
if (i18n.languages.indexOf(htmlLang) !== -1) {
|
||||
lang = document.documentElement.lang;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue