Properly set and call raidGroups from state

Does this fix our bug? We'll find out!
This commit is contained in:
Justin Edmund 2023-07-04 01:17:12 -07:00
parent 9c3c36e81b
commit 665a528047
3 changed files with 5 additions and 9 deletions

View file

@ -187,10 +187,8 @@ const ProfileRoute: React.FC<Props> = ({
// Fetch all raids on mount, then find the raid in the URL if present
useEffect(() => {
api.endpoints.raids.getAll().then((response) => {
const raids = appState.raidGroups.flatMap((group) => group.raids)
setRaids(raids)
})
const raids = appState.raidGroups.flatMap((group) => group.raids)
setRaids(raids)
}, [setRaids])
// When the element, raid or recency filter changes,

View file

@ -109,7 +109,7 @@ const NewRoute: React.FC<Props> = ({
useEffect(() => {
if (context && context.jobs && context.jobSkills) {
appState.raids = context.raidGroups
appState.raidGroups = context.raidGroups
appState.jobs = context.jobs
appState.jobSkills = context.jobSkills
appState.weaponKeys = context.weaponKeys

View file

@ -190,10 +190,8 @@ const SavedRoute: React.FC<Props> = ({
// Fetch all raids on mount, then find the raid in the URL if present
useEffect(() => {
api.endpoints.raids.getAll().then((response) => {
const raids = appState.raidGroups.flatMap((group) => group.raids)
setRaids(raids)
})
const raids = appState.raidGroups.flatMap((group) => group.raids)
setRaids(raids)
}, [setRaids])
// When the element, raid or recency filter changes,