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

feat: add notification for season

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