From 6d587ab8cab4645a14441f5ada40175522567c68 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Wed, 3 Apr 2024 22:56:19 +0200 Subject: [PATCH] fix adjust health --- components/Game/Header/header.components.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/Game/Header/header.components.tsx b/components/Game/Header/header.components.tsx index db926a6..ebce91e 100644 --- a/components/Game/Header/header.components.tsx +++ b/components/Game/Header/header.components.tsx @@ -116,7 +116,13 @@ export const PlayerBox: React.FC<{ updateSidekickQuantity(number)} + callback={(number: number) => { + if (sidekick?.quantity && sidekick?.quantity <= 1) { + updateHealth(number, "sidekick"); + } else { + updateSidekickQuantity(number); + } + }} number={ sidekick.quantity <= 1 ? sidekick.hp ?? 0