Skip to content

Commit

Permalink
fix: show loading error only on dev
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh committed Nov 13, 2024
1 parent 9892a50 commit 0f2a40b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/ui/src/services/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down

0 comments on commit 0f2a40b

Please sign in to comment.