fix: tank hot swapping no longer crashes

This commit is contained in:
tresabhi committed 2024-12-14 13:43:57 -06:00
1 parent 60b2e62713
commit 5b5e204cce
2 files changed
+4 -4

No files matched your search

@@ -17,9 +17,6 @@ export const XP_MULTIPLIERS = [1, 2, 3, 4, 5, 10];
export function TechTreeSection({ skeleton }: MaybeSkeletonComponentProps) {
const master = Duel.use((state) => state.protagonist.tank);
if (master.type !== TankType.RESEARCHABLE || master.deprecated) return null;
const xpMultiplier = TankopediaEphemeral.use((state) => state.xpMultiplier);
const mutateTankopediaEphemeral = TankopediaEphemeral.useMutation();
const container = useRef<HTMLDivElement>(null);
@@ -1,3 +1,4 @@
import { TankType } from '@blitzkit/core';
import { PageWrapper } from '../../../../components/PageWrapper';
import { CalloutsSection } from '../../../../components/Tankopedia/CalloutsSection';
import { CharacteristicsSection } from '../../../../components/Tankopedia/CharacteristicsSection';
@@ -42,7 +43,9 @@ export function Page({ id, skeleton }: PageProps) {
<HeroSection skeleton={skeleton} />
<CalloutsSection />
<MetaSection />
<TechTreeSection skeleton={skeleton} />
{tank.type === TankType.RESEARCHABLE && !tank.deprecated && (
<TechTreeSection skeleton={skeleton} />
)}
<CharacteristicsSection />
<GameModeSection />
<VideoSection skeleton={skeleton} />