From 39d17c4a3ca371fe8515a1d21cdc95de00d146cb Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Wed, 22 Jun 2022 22:06:29 +0530 Subject: [PATCH] fix: delay loading until language imported (#5344) --- src/components/InitializeApp.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/InitializeApp.tsx b/src/components/InitializeApp.tsx index f6ff278d..c1941512 100644 --- a/src/components/InitializeApp.tsx +++ b/src/components/InitializeApp.tsx @@ -14,11 +14,11 @@ export const InitializeApp = (props: Props) => { useEffect(() => { const updateLang = async () => { await setLanguage(currentLang); + setLoading(false); }; const currentLang = languages.find((lang) => lang.code === props.langCode) || defaultLang; updateLang(); - setLoading(false); }, [props.langCode]); return loading ? : props.children;