From e6d36410ce8a6157eca84a0b0cdcc8ae28c4dca2 Mon Sep 17 00:00:00 2001 From: Benoit Simard Date: Wed, 31 Jan 2024 13:34:22 +0100 Subject: [PATCH] Replacing NODE_ENV by MODE Following the vite migration --- src/components/LocalSwitcher.tsx | 7 +++---- src/locales/provider.tsx | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/LocalSwitcher.tsx b/src/components/LocalSwitcher.tsx index 5250307..02a1fc9 100644 --- a/src/components/LocalSwitcher.tsx +++ b/src/components/LocalSwitcher.tsx @@ -12,9 +12,9 @@ const DEFAULT_FLAG = ; function getIcon(locale: string): ReactNode { return locale === "dev" ? DEFAULT_FLAG : localeEmoji(locale) || DEFAULT_FLAG; } - +console.log(import.meta.env); const AVAILABLE_LOCALES = toPairs(LOCALES) - .filter(([key]) => import.meta.env.NODE_ENV === "development" || key !== "dev") + .filter(([key]) => import.meta.env.MODE === "development" || key !== "dev") .map(([key, locale]) => ({ value: key, label: ( @@ -27,10 +27,9 @@ const AVAILABLE_LOCALES = toPairs(LOCALES) const LocalSwitcher: FC = () => { const { locale } = usePreferences(); const { changeLocale } = usePreferencesActions(); - return ( - +
{AVAILABLE_LOCALES.map((option, i) => (