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

Merge branch 'features/US283-boss_notification' into 'dev'

Features/us283 boss notification

See merge request web-et-numerique/llle_project/ecolyo!148
parents 713ed834 f603b430
Branches
Tags
1 merge request!148Features/us283 boss notification
......@@ -4,20 +4,18 @@ import classNames from 'classnames'
import { useDispatch } from 'react-redux'
import {
toogleReportNotification,
toogleSeasonNotification,
setFluidStatus,
} from 'store/global/global.actions'
import { updateProfile } from 'store/profile/profile.actions'
import {
setUserSeasonList,
setSeasonConsumption,
updateUserSeasonList,
unlockNextUserSeason,
} from 'store/season/season.actions'
import InitializationService from 'services/initialization.service'
import { UserSeasonState } from 'enum/userSeason.enum'
import { UserBossState } from 'enum/userBoss.enum'
import SeasonService from 'services/season.service'
import { UpdateUserSeason } from 'enum/updateUserSeason.enum'
interface SplashRootProps {
fadeTimer?: number
......@@ -120,22 +118,13 @@ const SplashRoot = ({
filteredCurrentBossSeason[0]
)
dispatch(setSeasonConsumption(updatedUserSeason, dataloads))
// Check is boss is done
// Check is boss is done and siplay notification
const seasonService = new SeasonService(client)
const { isDone, isWin } = await seasonService.isSeasonDone(
const { isDone } = await seasonService.isSeasonDone(
updatedUserSeason,
dataloads
)
if (isDone === true) {
const doneUserSeason = await seasonService.updateUserSeason(
updatedUserSeason,
isWin === true
? UpdateUserSeason.BOSS_WIN
: UpdateUserSeason.BOSS_LOSS
)
dispatch(updateUserSeasonList(doneUserSeason))
dispatch(unlockNextUserSeason(doneUserSeason))
}
dispatch(toogleSeasonNotification(isDone))
}
}
// Update state
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment