Skip to content
Snippets Groups Projects
Commit 1ebcf5b5 authored by Yoan VALLET's avatar Yoan VALLET
Browse files

feat: track loding success for userprofile on init

parent b2a1b769
No related branches found
No related tags found
1 merge request!15Merge Dev to Master
......@@ -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,
])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment