From 0f2a40bbca741db0a3e58057ea45a564578df6ef Mon Sep 17 00:00:00 2001 From: Felix Mosheev <9304194+felixmosh@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:32:21 +0200 Subject: [PATCH] fix: show loading error only on dev --- packages/ui/src/services/i18n.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/services/i18n.ts b/packages/ui/src/services/i18n.ts index 08e4afd6..75020eb7 100644 --- a/packages/ui/src/services/i18n.ts +++ b/packages/ui/src/services/i18n.ts @@ -12,8 +12,10 @@ const dateFnsLocaleMap = { async function setDateFnsLocale(lng: string) { const languageToLoad = dateFnsLocaleMap[lng as keyof typeof dateFnsLocaleMap] || lng; dateFnsLocale = await import(`date-fns/locale/${languageToLoad}/index.js`).catch((e) => { - // eslint-disable-next-line no-console - console.info(e); + if (process.env.NODE_ENV === 'development') { + // eslint-disable-next-line no-console + console.info(e); + } return enLocale; });