Skip to content

Commit

Permalink
fix: removed the initialization event check
Browse files Browse the repository at this point in the history
  • Loading branch information
likhith-deriv committed Jun 10, 2024
1 parent e3db371 commit 3f5732d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/provider/translation-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ export default function TranslationProvider({

useEffect(() => {
if (i18nInstance) {
console.log("Library: i18nInstance initialized.");
const initialLang = i18nInstance.language || defaultLang || "";
setCurrentLanguage(initialLang);

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

console.log("Library: ", {
i18nInstance,
isTranslationsLoaded,
});

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

return (
Expand Down

0 comments on commit 3f5732d

Please sign in to comment.