Skip to content

Commit

Permalink
fix: undefined current lang issue on firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
amir-deriv committed May 23, 2024
1 parent 37f875d commit dc284d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/provider/translation-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ export default function TranslationProvider({

useEffect(() => {
if (i18nInstance) {
const initialLang = i18nInstance.language;
const initialLang = i18nInstance.language || defaultLang || "";
setCurrentLanguage(initialLang);

i18nInstance.on("initialized", () => {
setIsTranslationsLoaded(true);
});
}
}, [i18nInstance]);
}, [i18nInstance, defaultLang]);

if (!i18nInstance || !isTranslationsLoaded) return null;

Expand Down

0 comments on commit dc284d0

Please sign in to comment.