mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: use short tank name
This commit is contained in:
1 parent
bdc7132337
commit
67e45ada85
3 files changed
+9
-9
No files matched your search
@@ -1,6 +0,0 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { tankopedia } from '../../../core/blitzkrieg/tankopedia';
|
||||
|
||||
export async function GET() {
|
||||
return NextResponse.json(await tankopedia);
|
||||
}
|
||||
@@ -295,7 +295,11 @@ export default function SessionPage() {
|
||||
<Breakdown.Row
|
||||
key={stats.tank_id}
|
||||
minimized={!session.showCareer}
|
||||
title={tankopedia?.name ?? `Unknown tank ${stats.tank_id}`}
|
||||
title={
|
||||
tankopedia?.name_short ??
|
||||
tankopedia?.name ??
|
||||
`Unknown tank ${stats.tank_id}`
|
||||
}
|
||||
type="tank"
|
||||
tankType={tankopedia?.type}
|
||||
treeType={(() => {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { tankopedia } from '../blitzkrieg/tankopedia';
|
||||
|
||||
export default async function resolveTankName(tankId: number) {
|
||||
const tankopediaName = (await tankopedia)[tankId]?.name;
|
||||
return tankopediaName ? tankopediaName : `Unknown Tank ${tankId}`;
|
||||
const awaitedTankopedia = await tankopedia;
|
||||
const entry = awaitedTankopedia[tankId];
|
||||
|
||||
return entry?.name_short ?? entry?.name ?? `Unknown Tank ${tankId}`;
|
||||
}
|
||||
Reference in new issue
Block a user