mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
fix: edge case for unplayed tanks
This commit is contained in:
1 parent
831300cf69
commit
65b2eb8beb
3 files changed
+19
-6
No files matched your search
@@ -18,7 +18,9 @@ import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
|||||||
import resolveTankId from '../core/blitz/resolveTankId.js';
|
import resolveTankId from '../core/blitz/resolveTankId.js';
|
||||||
import getPeriodNow from '../core/blitzstars/getPeriodNow.js';
|
import getPeriodNow from '../core/blitzstars/getPeriodNow.js';
|
||||||
import getPeriodicStart from '../core/blitzstars/getPeriodStart.js';
|
import getPeriodicStart from '../core/blitzstars/getPeriodStart.js';
|
||||||
import getTankStatsOverTime from '../core/blitzstars/getTankStatsOverTime.js';
|
import getTankStatsOverTime, {
|
||||||
|
emptyAllStats,
|
||||||
|
} from '../core/blitzstars/getTankStatsOverTime.js';
|
||||||
import { tankopedia } from '../core/blitzstars/tankopedia.js';
|
import { tankopedia } from '../core/blitzstars/tankopedia.js';
|
||||||
import cmdName from '../core/interaction/cmdName.js';
|
import cmdName from '../core/interaction/cmdName.js';
|
||||||
import addStatPeriodChoices, {
|
import addStatPeriodChoices, {
|
||||||
@@ -64,9 +66,9 @@ export default {
|
|||||||
let stats: AllStats;
|
let stats: AllStats;
|
||||||
|
|
||||||
if (period === 'career') {
|
if (period === 'career') {
|
||||||
stats = tankStats[id].find(
|
stats =
|
||||||
(stats) => stats.tank_id === Number(tank),
|
tankStats[id].find((stats) => stats.tank_id === Number(tank))?.all ??
|
||||||
)!.all;
|
emptyAllStats;
|
||||||
} else {
|
} else {
|
||||||
stats = (
|
stats = (
|
||||||
await getTankStatsOverTime(
|
await getTankStatsOverTime(
|
||||||
|
|||||||
@@ -42,7 +42,13 @@ export function RowStat({ name, value, career, delta }: RowStatProps) {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<span style={{ color: theme.colors.textHighContrast, fontSize: 16, fontWeight: 'bold' }}>
|
<span
|
||||||
|
style={{
|
||||||
|
color: theme.colors.textHighContrast,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
}}
|
||||||
|
>
|
||||||
{value}
|
{value}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import isDev from '../core/process/isDev.js';
|
||||||
import { theme } from '../stitches.config.js';
|
import { theme } from '../stitches.config.js';
|
||||||
|
|
||||||
export interface TitleBarProps {
|
export interface TitleBarProps {
|
||||||
@@ -75,7 +76,11 @@ export default function TitleBar({
|
|||||||
|
|
||||||
<img
|
<img
|
||||||
style={{ width: 64, height: 64 }}
|
style={{ width: 64, height: 64 }}
|
||||||
src="https://i.imgur.com/35phKIu.png"
|
src={
|
||||||
|
isDev()
|
||||||
|
? 'https://i.imgur.com/j6TItdy.png'
|
||||||
|
: 'https://i.imgur.com/pP6RN0x.png'
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user