diff --git a/src/components/Contexts/AppContextProvider.tsx b/src/components/Contexts/AppContextProvider.tsx index dfc788f478a83ce118eca02f0c2e58fd3d9aba41..1a2e767f26ae75af792c4ef0045562b854d2ebca 100644 --- a/src/components/Contexts/AppContextProvider.tsx +++ b/src/components/Contexts/AppContextProvider.tsx @@ -94,6 +94,10 @@ const AppContextProvider: React.FC<AppContextProviderProps> = ({ const [isContextLoaded, setContextLoaded] = useState<boolean>(false) const [isError, setError] = useState<boolean>(false) const [screenType, setScreenType] = useState<ScreenType>(ScreenType.MOBILE) + + const [isUserProfileLoadingSuccess, setUserProfileLoadingSuccess] = useState< + boolean | null + >(null) const [userProfile, setUserProfile] = useState<UserProfile | null>(null) const defineScreenType = () => { @@ -250,6 +254,7 @@ const AppContextProvider: React.FC<AppContextProviderProps> = ({ 'background: #222; color: white' ) setUserProfile(loadedUserProfile) + setUserProfileLoadingSuccess(true) } } loadData() @@ -265,6 +270,7 @@ const AppContextProvider: React.FC<AppContextProviderProps> = ({ isDataLoadingSuccess && isFluidTypesLoadingSuccess && isCurrentChallengeUpdateLoadingSuccess && + isUserProfileLoadingSuccess && !isError ) { setTimeout(function() { @@ -276,6 +282,7 @@ const AppContextProvider: React.FC<AppContextProviderProps> = ({ isDataLoadingSuccess, isFluidTypesLoadingSuccess, isCurrentChallengeUpdateLoadingSuccess, + isUserProfileLoadingSuccess, isError, ])