generated from nhcarrigan/template
fix: apply boss bounty runestones to local client state immediately
Without this, the client would auto-save stale state (runestones: 0) after a first-kill bounty, causing the server's validateAndSanitize to overwrite the correctly-persisted DB value back to zero.
This commit is contained in:
@@ -463,6 +463,12 @@ export const GameProvider = ({ children }: { children: React.ReactNode }): React
|
|||||||
crystals: prev.resources.crystals + result.rewards.crystals,
|
crystals: prev.resources.crystals + result.rewards.crystals,
|
||||||
}
|
}
|
||||||
: prev.resources,
|
: prev.resources,
|
||||||
|
prestige: result.rewards?.bountyRunestones
|
||||||
|
? {
|
||||||
|
...prev.prestige,
|
||||||
|
runestones: prev.prestige.runestones + result.rewards.bountyRunestones,
|
||||||
|
}
|
||||||
|
: prev.prestige,
|
||||||
player: result.rewards
|
player: result.rewards
|
||||||
? {
|
? {
|
||||||
...prev.player,
|
...prev.player,
|
||||||
|
|||||||
Reference in New Issue
Block a user