Store party details in state when data is fetched
This commit is contained in:
parent
45c133f450
commit
0a096e9dc0
3 changed files with 39 additions and 0 deletions
|
|
@ -78,6 +78,19 @@ const CharacterGrid = (props: Props) => {
|
|||
// Store the important party and state-keeping values
|
||||
appState.party.id = party.id
|
||||
|
||||
// Store the party's user-generated details
|
||||
if (party.name) {
|
||||
appState.party.name = {
|
||||
en: party.name.en,
|
||||
jp: party.name.jp
|
||||
}
|
||||
}
|
||||
if (party.description)
|
||||
appState.party.description = party.description
|
||||
|
||||
if (party.raid)
|
||||
appState.raid = party.raid
|
||||
|
||||
setFound(true)
|
||||
setLoading(false)
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,19 @@ const SummonGrid = (props: Props) => {
|
|||
// Store the important party and state-keeping values
|
||||
appState.party.id = party.id
|
||||
|
||||
// Store the party's user-generated details
|
||||
if (party.name) {
|
||||
appState.party.name = {
|
||||
en: party.name.en,
|
||||
jp: party.name.jp
|
||||
}
|
||||
}
|
||||
if (party.description)
|
||||
appState.party.description = party.description
|
||||
|
||||
if (party.raid)
|
||||
appState.raid = party.raid
|
||||
|
||||
setFound(true)
|
||||
setLoading(false)
|
||||
|
||||
|
|
|
|||
|
|
@ -85,6 +85,19 @@ const WeaponGrid = (props: Props) => {
|
|||
appState.party.id = party.id
|
||||
appState.party.extra = party.is_extra
|
||||
|
||||
// Store the party's user-generated details
|
||||
if (party.name) {
|
||||
appState.party.name = {
|
||||
en: party.name.en,
|
||||
jp: party.name.jp
|
||||
}
|
||||
}
|
||||
if (party.description)
|
||||
appState.party.description = party.description
|
||||
|
||||
if (party.raid)
|
||||
appState.raid = party.raid
|
||||
|
||||
setFound(true)
|
||||
setLoading(false)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue