fix: update all

This commit is contained in:
TrèsAbhi committed 2026-03-31 14:11:45 -05:00
1 parent bdea9fdab3
commit e2f50871ec
86 files changed
+1939 -1537

No files matched your search

@@ -36,7 +36,7 @@ export function Node({ id, highlight, nextIds, skeleton }: NodeProps) {
? 0
: (tank.research_cost.research_cost_type!.value as number) /
xpMultiplier),
0
0,
);
const averages = averageDefinitions.averages[tank.id]?.mu;
const averageXp = averages ? averages.xp / averages.battles : undefined;
@@ -78,7 +78,7 @@ export function Node({ id, highlight, nextIds, skeleton }: NodeProps) {
}}
>
<img
alt={unwrap(tank.name)}
alt={unwrap(tank.name!)}
src={asset(`icons/tanks/big/${id}.webp`)}
width={64}
height={64}
@@ -92,7 +92,7 @@ export function Node({ id, highlight, nextIds, skeleton }: NodeProps) {
<Text color="gray" size="1">
{TIER_ROMAN_NUMERALS[tank.tier]}
</Text>
<Text wrap="nowrap">{unwrap(tank.name)}</Text>
<Text wrap="nowrap">{unwrap(tank.name!)}</Text>
</Flex>
<Flex gap="2" align="center">
<Text color="gray" size="1" wrap="nowrap">
@@ -122,7 +122,7 @@ export function Node({ id, highlight, nextIds, skeleton }: NodeProps) {
objectPosition: "center",
}}
/>
{formatCompact(locale, tank.price.value)}
{formatCompact(locale, tank.price!.value)}
</Flex>
</Text>
</Flex>
@@ -135,7 +135,7 @@ export function Node({ id, highlight, nextIds, skeleton }: NodeProps) {
? strings.website.tools.tankopedia.tech_tree.battle
: literals(
strings.website.tools.tankopedia.tech_tree.battles,
{ count: games }
{ count: games },
))}
</Text>
)}
@@ -26,14 +26,18 @@ export function TechTreeSection({ skeleton }: MaybeSkeletonComponentProps) {
function extend(line: Line): Line[] {
const root = tankDefinitions.tanks[line.at(-1)!];
if (root.ancestors === undefined || root.ancestors.length === 0 || root.tier === 1) {
if (
root.ancestors === undefined ||
root.ancestors.length === 0 ||
root.tier === 1
) {
return [line];
} else {
if (root.ancestors.length === 1 || root.tier === 2) {
line.push(
root.ancestors.find(
(ancestor) => !tankDefinitions.tanks[ancestor].deprecated
) ?? root.ancestors[0]
(ancestor) => !tankDefinitions.tanks[ancestor].deprecated,
) ?? root.ancestors[0],
);
return extend(line);
} else {
@@ -52,7 +56,7 @@ export function TechTreeSection({ skeleton }: MaybeSkeletonComponentProps) {
const [lineIndex, setLineIndex] = useState(0);
const line = useMemo(
() => (lines.length === 0 ? [master.id] : [...lines[lineIndex]].reverse()),
[master, lineIndex]
[master, lineIndex],
);
const totalXp = line.reduce(
(xp, id) =>
@@ -62,11 +66,11 @@ export function TechTreeSection({ skeleton }: MaybeSkeletonComponentProps) {
? 0
: (tankDefinitions.tanks[id].research_cost.research_cost_type!
.value as number)),
0
0,
);
const totalCredits = line.reduce(
(credits, id) => credits + tankDefinitions.tanks[id].price.value,
0
(credits, id) => credits + tankDefinitions.tanks[id].price!.value,
0,
);
useEffect(() => {
@@ -75,7 +79,7 @@ export function TechTreeSection({ skeleton }: MaybeSkeletonComponentProps) {
});
if (
master.type !== TankType.RESEARCHABLE ||
master.type !== TankType.TANK_TYPE_RESEARCHABLE ||
master.ancestors === undefined ||
master.ancestors.length === 0
) {