From 26ae7bcbdfebd8df233d380c925d826e46012a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:49:05 -0600 Subject: [PATCH] fix: remove shot after module change --- .../tools/tankopedia/[id]/components/AntagonistBar/index.tsx | 3 +++ .../[id]/components/Characteristics/components/Modules.tsx | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/app/tools/tankopedia/[id]/components/AntagonistBar/index.tsx b/src/app/tools/tankopedia/[id]/components/AntagonistBar/index.tsx index ddb88c461..736a04e71 100644 --- a/src/app/tools/tankopedia/[id]/components/AntagonistBar/index.tsx +++ b/src/app/tools/tankopedia/[id]/components/AntagonistBar/index.tsx @@ -150,6 +150,9 @@ export function AntagonistBar() { draft.antagonist!.shell = draft.antagonist!.gun.shells[0]; }); + mutateTankopediaTemporary((draft) => { + draft.shot = undefined; + }); }} selected={antagonist.turret.id === turret.id} discriminator={ diff --git a/src/app/tools/tankopedia/[id]/components/Characteristics/components/Modules.tsx b/src/app/tools/tankopedia/[id]/components/Characteristics/components/Modules.tsx index 3b8b01453..fc258968c 100644 --- a/src/app/tools/tankopedia/[id]/components/Characteristics/components/Modules.tsx +++ b/src/app/tools/tankopedia/[id]/components/Characteristics/components/Modules.tsx @@ -2,6 +2,7 @@ import { Flex, Heading } from '@radix-ui/themes'; import { ModuleButton } from '../../../../../../../components/ModuleButtons/ModuleButton'; import { TIER_ROMAN_NUMERALS } from '../../../../../../../core/blitzkrieg/tankDefinitions'; import { mutateDuel, useDuel } from '../../../../../../../stores/duel'; +import { mutateTankopediaTemporary } from '../../../../../../../stores/tankopedia'; import { ConfigurationChildWrapper } from './ConfigurationChildWrapper'; export function Modules() { @@ -29,6 +30,9 @@ export function Modules() { draft.protagonist!.gun = turret.guns.at(-1)!; draft.protagonist!.shell = turret.guns.at(-1)!.shells[0]; }); + mutateTankopediaTemporary((draft) => { + draft.shot = undefined; + }); }} /> );