mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +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 = {
|
||||
inProduction: true,
|
||||
inDevelopment: false,
|
||||
inDevelopment: true,
|
||||
inPublic: true,
|
||||
|
||||
command: addStatTypeSubCommandGroups(
|
||||
|
||||
@@ -20,7 +20,7 @@ import { AccountInfo } from '../types/accountInfo.js';
|
||||
|
||||
export const statsCommand: CommandRegistry = {
|
||||
inProduction: true,
|
||||
inDevelopment: false,
|
||||
inDevelopment: true,
|
||||
inPublic: true,
|
||||
|
||||
command: addStatTypeSubCommandGroups(
|
||||
|
||||
@@ -52,7 +52,7 @@ export default async function stats<Type extends StatType>(
|
||||
}
|
||||
|
||||
const tankStats = await getTankStatsDiffed(server, id, start, end);
|
||||
let stats: AllStats;
|
||||
let stats: AllStats | undefined;
|
||||
let supplementaryStats: SupplementaryStats;
|
||||
let tierWeights: TierWeightsRecord;
|
||||
|
||||
@@ -117,7 +117,9 @@ export default async function stats<Type extends StatType>(
|
||||
stats = tankStats[tankId!];
|
||||
|
||||
supplementaryStats = {
|
||||
WN8: calculateWN8(tankAverages[tankId!].all, tankStats[tankId!]),
|
||||
WN8: stats
|
||||
? calculateWN8(tankAverages[tankId!].all, tankStats[tankId!])
|
||||
: undefined,
|
||||
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 > 0 && overview}
|
||||
{!stats?.battles && <NoData type={NoDataType.BattlesInPeriod} />}
|
||||
{stats?.battles > 0 && overview}
|
||||
|
||||
<PoweredBy type={PoweredByType.BlitzStars} footer={footer} />
|
||||
</Wrapper>
|
||||
|
||||
Reference in new issue
Block a user