瀏覽代碼

fix: delay loading until language imported (#5344)

Aakansha Doshi 3 年之前
父節點
當前提交
39d17c4a3c
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/components/InitializeApp.tsx

+ 1 - 1
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 ? <LoadingMessage /> : props.children;