Skip to content

Commit

Permalink
fix adjust health
Browse files Browse the repository at this point in the history
  • Loading branch information
JollyGrin committed Apr 3, 2024
1 parent 3e73d58 commit 6d587ab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/Game/Header/header.components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ export const PlayerBox: React.FC<{
<Stat
isLocal={isLocal}
Icon={sidekick.quantity <= 1 ? IconHeart : IconSidekicks}
callback={(number: number) => updateSidekickQuantity(number)}
callback={(number: number) => {
if (sidekick?.quantity && sidekick?.quantity <= 1) {
updateHealth(number, "sidekick");
} else {
updateSidekickQuantity(number);
}
}}
number={
sidekick.quantity <= 1
? sidekick.hp ?? 0
Expand Down

0 comments on commit 6d587ab

Please sign in to comment.