Move storeGridWeapon to after conflict deletion

Otherwise, we delete what we just stored
This commit is contained in:
Justin Edmund 2023-01-29 23:36:37 -08:00
parent 44c0e96474
commit fa6b312f06

View file

@ -183,9 +183,6 @@ const WeaponGrid = (props: Props) => {
position: position,
})
.then((response) => {
// Store new character in state
storeGridWeapon(response.data)
// Remove conflicting characters from state
conflicts.forEach((c) => {
if (appState.grid.weapons.mainWeapon?.object.id === c.id) {
@ -196,6 +193,9 @@ const WeaponGrid = (props: Props) => {
}
})
// Store new character in state
storeGridWeapon(response.data.grid_weapon)
// Reset conflict
resetConflict()