From 1245fab7ae47221c3a4a3b231f6a22251ff7f298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Wed, 3 Jan 2024 14:05:06 -0600 Subject: [PATCH] fix: next gun/turret selection --- src/app/tools/tankopedia/[id]/page.tsx | 40 ++++++++++++-------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/src/app/tools/tankopedia/[id]/page.tsx b/src/app/tools/tankopedia/[id]/page.tsx index 29d91db92..b8c60bafb 100644 --- a/src/app/tools/tankopedia/[id]/page.tsx +++ b/src/app/tools/tankopedia/[id]/page.tsx @@ -90,21 +90,6 @@ export default function Page({ params }: { params: { id: string } }) { const gunPitchInput = useRef(null); const gunContainer = useRef(null); - useEffect(() => { - if (!turret.guns.some(({ id }) => gun.id === id)) { - setGun(turret.guns.at(-1)!); - } - }, [turret]); - useEffect(() => { - if (!versusTank.turrets.some(({ id }) => id === versusTurret.id)) { - setVersusTurret(versusTank.turrets.at(-1)!); - } - }, [versusTank]); - useEffect(() => { - if (!versusTurret.guns.some(({ id }) => id === versusGun.id)) { - setVersusGun(versusTurret.guns.at(-1)!); - } - }, [versusTurret]); useEffect(() => { hullYawInput.current!.value = `${-Math.round(hullYaw * (180 / Math.PI))}`; }, [hullYaw]); @@ -318,7 +303,10 @@ export default function Page({ params }: { params: { id: string } }) { return (