From 6373e95e5ce36d2ed68f388c89c8a56119fd61db Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Wed, 25 Dec 2019 13:30:47 +0200 Subject: [PATCH] Fix local flag icon url --- packages/app/components/i18n/localeFlags.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/app/components/i18n/localeFlags.ts b/packages/app/components/i18n/localeFlags.ts index 6d390ed..24360f7 100644 --- a/packages/app/components/i18n/localeFlags.ts +++ b/packages/app/components/i18n/localeFlags.ts @@ -28,7 +28,11 @@ export default { * @returns {string} */ getIconUrl(locale: string): string { - return require(`flag-icon-css/flags/4x3/${localeToCountryCode[locale] || - locale}.svg`); + // eslint-disable-next-line @typescript-eslint/no-var-requires + const mod = require(`flag-icon-css/flags/4x3/${localeToCountryCode[ + locale + ] || locale}.svg`); + + return mod.default || mod; }, };