Properly set and call raidGroups from state
Does this fix our bug? We'll find out!
This commit is contained in:
parent
9c3c36e81b
commit
665a528047
3 changed files with 5 additions and 9 deletions
|
|
@ -187,10 +187,8 @@ const ProfileRoute: React.FC<Props> = ({
|
||||||
|
|
||||||
// Fetch all raids on mount, then find the raid in the URL if present
|
// Fetch all raids on mount, then find the raid in the URL if present
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
api.endpoints.raids.getAll().then((response) => {
|
|
||||||
const raids = appState.raidGroups.flatMap((group) => group.raids)
|
const raids = appState.raidGroups.flatMap((group) => group.raids)
|
||||||
setRaids(raids)
|
setRaids(raids)
|
||||||
})
|
|
||||||
}, [setRaids])
|
}, [setRaids])
|
||||||
|
|
||||||
// When the element, raid or recency filter changes,
|
// When the element, raid or recency filter changes,
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ const NewRoute: React.FC<Props> = ({
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (context && context.jobs && context.jobSkills) {
|
if (context && context.jobs && context.jobSkills) {
|
||||||
appState.raids = context.raidGroups
|
appState.raidGroups = context.raidGroups
|
||||||
appState.jobs = context.jobs
|
appState.jobs = context.jobs
|
||||||
appState.jobSkills = context.jobSkills
|
appState.jobSkills = context.jobSkills
|
||||||
appState.weaponKeys = context.weaponKeys
|
appState.weaponKeys = context.weaponKeys
|
||||||
|
|
|
||||||
|
|
@ -190,10 +190,8 @@ const SavedRoute: React.FC<Props> = ({
|
||||||
|
|
||||||
// Fetch all raids on mount, then find the raid in the URL if present
|
// Fetch all raids on mount, then find the raid in the URL if present
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
api.endpoints.raids.getAll().then((response) => {
|
|
||||||
const raids = appState.raidGroups.flatMap((group) => group.raids)
|
const raids = appState.raidGroups.flatMap((group) => group.raids)
|
||||||
setRaids(raids)
|
setRaids(raids)
|
||||||
})
|
|
||||||
}, [setRaids])
|
}, [setRaids])
|
||||||
|
|
||||||
// When the element, raid or recency filter changes,
|
// When the element, raid or recency filter changes,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue