Fix bug with RaidCombobox and Farming
Selecting farming then opening the raid combobox *twice* consecutively would put you in no segment, so no raids appeared Fixes #323
This commit is contained in:
parent
6687e71bb1
commit
23d37bba93
1 changed files with 18 additions and 8 deletions
|
|
@ -105,19 +105,25 @@ const RaidCombobox = (props: Props) => {
|
||||||
|
|
||||||
// Set current raid and section when the component mounts
|
// Set current raid and section when the component mounts
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (appState.party.raid) {
|
// if (appState.party.raid) {
|
||||||
setCurrentRaid(appState.party.raid)
|
// setCurrentRaid(appState.party.raid)
|
||||||
setCurrentSection(appState.party.raid.group.section)
|
// if (appState.party.raid.group.section > 0) {
|
||||||
} else if (props.showAllRaidsOption && !currentRaid) {
|
// setCurrentSection(appState.party.raid.group.section)
|
||||||
setCurrentRaid(allRaidsOption)
|
// } else {
|
||||||
}
|
// setCurrentSection(1)
|
||||||
|
// }
|
||||||
|
// } else if (props.showAllRaidsOption && !currentRaid) {
|
||||||
|
// setCurrentRaid(allRaidsOption)
|
||||||
|
// }
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
// Set current raid and section when the current raid changes
|
// Set current raid and section when the current raid changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (props.currentRaid) {
|
if (props.currentRaid) {
|
||||||
setCurrentRaid(props.currentRaid)
|
setCurrentRaid(props.currentRaid)
|
||||||
|
if (appState.party.raid && appState.party.raid.group.section > 0)
|
||||||
setCurrentSection(props.currentRaid.group.section)
|
setCurrentSection(props.currentRaid.group.section)
|
||||||
|
else setCurrentSection(1)
|
||||||
}
|
}
|
||||||
}, [props.currentRaid])
|
}, [props.currentRaid])
|
||||||
|
|
||||||
|
|
@ -260,7 +266,11 @@ const RaidCombobox = (props: Props) => {
|
||||||
// Toggle the open state of the combobox
|
// Toggle the open state of the combobox
|
||||||
function toggleOpen() {
|
function toggleOpen() {
|
||||||
if (open) {
|
if (open) {
|
||||||
if (currentRaid && currentRaid.slug !== 'all') {
|
if (
|
||||||
|
currentRaid &&
|
||||||
|
currentRaid.slug !== 'all' &&
|
||||||
|
currentRaid.group.section > 0
|
||||||
|
) {
|
||||||
setCurrentSection(currentRaid.group.section)
|
setCurrentSection(currentRaid.group.section)
|
||||||
}
|
}
|
||||||
setScrolled(false)
|
setScrolled(false)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue