Skip to content
Snippets Groups Projects
Commit 0421e57d authored by Guilhem CARRON's avatar Guilhem CARRON
Browse files

fix(challenges): Handle case user finished all challenges

parent 5a3a6f91
Branches
Tags
3 merge requests!587chore(release): 1.8.3 (cozy-fix),!586chore(release): 1.8.2,!585Resolve "Impossible d'accéder à Ecolyo"
...@@ -306,7 +306,7 @@ const SplashRoot = ({ fadeTimer = 1000, children }: SplashRootProps) => { ...@@ -306,7 +306,7 @@ const SplashRoot = ({ fadeTimer = 1000, children }: SplashRootProps) => {
})) }))
} }
} catch (err) { } catch (err) {
if (err instanceof TypeError && !initStepErrors) { if (err.message === 'Failed to fetch' && !initStepErrors) {
setinitStepErrors(InitStepsErrors.UNKNOWN_ERROR) setinitStepErrors(InitStepsErrors.UNKNOWN_ERROR)
} }
log.error(`[Initialization] Error : ${err}`) log.error(`[Initialization] Error : ${err}`)
......
...@@ -59,7 +59,10 @@ export default class ChallengeService { ...@@ -59,7 +59,10 @@ export default class ChallengeService {
userChallenges.forEach((challenge, i) => { userChallenges.forEach((challenge, i) => {
if (challenge.state != UserChallengeState.LOCKED) isAllLocked = false if (challenge.state != UserChallengeState.LOCKED) isAllLocked = false
if (challenge.state === UserChallengeState.DONE) { 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 userChallenges[i + 1].state = UserChallengeState.UNLOCKED
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment