mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: stats now handles unowned tanks
This commit is contained in:
1 parent
433ffba1e3
commit
95b105cb65
3 files changed
+8
-6
No files matched your search
@@ -20,7 +20,7 @@ import { AccountInfo } from '../types/accountInfo.js';
|
|||||||
|
|
||||||
export const evolutionCommand: CommandRegistry = {
|
export const evolutionCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: false,
|
inDevelopment: true,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: addStatTypeSubCommandGroups(
|
command: addStatTypeSubCommandGroups(
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { AccountInfo } from '../types/accountInfo.js';
|
|||||||
|
|
||||||
export const statsCommand: CommandRegistry = {
|
export const statsCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: false,
|
inDevelopment: true,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: addStatTypeSubCommandGroups(
|
command: addStatTypeSubCommandGroups(
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export default async function stats<Type extends StatType>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const tankStats = await getTankStatsDiffed(server, id, start, end);
|
const tankStats = await getTankStatsDiffed(server, id, start, end);
|
||||||
let stats: AllStats;
|
let stats: AllStats | undefined;
|
||||||
let supplementaryStats: SupplementaryStats;
|
let supplementaryStats: SupplementaryStats;
|
||||||
let tierWeights: TierWeightsRecord;
|
let tierWeights: TierWeightsRecord;
|
||||||
|
|
||||||
@@ -117,7 +117,9 @@ export default async function stats<Type extends StatType>(
|
|||||||
stats = tankStats[tankId!];
|
stats = tankStats[tankId!];
|
||||||
|
|
||||||
supplementaryStats = {
|
supplementaryStats = {
|
||||||
WN8: calculateWN8(tankAverages[tankId!].all, tankStats[tankId!]),
|
WN8: stats
|
||||||
|
? calculateWN8(tankAverages[tankId!].all, tankStats[tankId!])
|
||||||
|
: undefined,
|
||||||
tier: tankopedia[tankId!].tier,
|
tier: tankopedia[tankId!].tier,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -154,8 +156,8 @@ export default async function stats<Type extends StatType>(
|
|||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{stats.battles === 0 && <NoData type={NoDataType.BattlesInPeriod} />}
|
{!stats?.battles && <NoData type={NoDataType.BattlesInPeriod} />}
|
||||||
{stats.battles > 0 && overview}
|
{stats?.battles > 0 && overview}
|
||||||
|
|
||||||
<PoweredBy type={PoweredByType.BlitzStars} footer={footer} />
|
<PoweredBy type={PoweredByType.BlitzStars} footer={footer} />
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
|
|||||||
Reference in new issue
Block a user