diff --git a/src/components/Splash/SplashRoot.tsx b/src/components/Splash/SplashRoot.tsx index b7b56ecd6c0ef9971b97d2d17348c9572fd1e8f7..06d2bb29c92b026243def3c0993654c70156f683 100644 --- a/src/components/Splash/SplashRoot.tsx +++ b/src/components/Splash/SplashRoot.tsx @@ -306,7 +306,7 @@ const SplashRoot = ({ fadeTimer = 1000, children }: SplashRootProps) => { })) } } catch (err) { - if (err instanceof TypeError && !initStepErrors) { + if (err.message === 'Failed to fetch' && !initStepErrors) { setinitStepErrors(InitStepsErrors.UNKNOWN_ERROR) } log.error(`[Initialization] Error : ${err}`) diff --git a/src/services/challenge.service.ts b/src/services/challenge.service.ts index 255e008f2a719ceccb7370a7f217bbba5fed2963..6fc4b25a30c3b479e0c584e6650f335622a8422c 100644 --- a/src/services/challenge.service.ts +++ b/src/services/challenge.service.ts @@ -59,7 +59,10 @@ export default class ChallengeService { userChallenges.forEach((challenge, i) => { if (challenge.state != UserChallengeState.LOCKED) isAllLocked = false if (challenge.state === UserChallengeState.DONE) { - if (userChallenges[i + 1].state === UserChallengeState.LOCKED) { + if ( + userChallenges[i + 1] && + userChallenges[i + 1].state === UserChallengeState.LOCKED + ) { userChallenges[i + 1].state = UserChallengeState.UNLOCKED } }