fix: a few type erros

This commit is contained in:
TrèsAbhi committed 2023-10-11 19:04:58 -05:00
1 parent 59bae96c1b
commit 0db96795b3
7 files changed
+8 -19

No files matched your search

-1
View File
@@ -15,7 +15,6 @@ import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton';
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
import { CommandRegistryRaw } from '../events/interactionCreate';
import evolution from '../renderers/evolution';
import { StatType } from '../renderers/stats';
import { AccountInfo } from '../types/accountInfo';
export const evolutionCommand = new Promise<CommandRegistryRaw>(
+1 -6
View File
@@ -91,17 +91,12 @@ export const ownedTanksCommand: CommandRegistry = {
<Wrapper>
<TitleBar
name={accountInfo[id].nickname}
nameDiscriminator={
clanData[id]?.clan ? `[${clanData[id]?.clan?.tag}]` : undefined
}
image={
clanData[id]?.clan
? `https://wotblitz-gc.gcdn.co/icons/clanEmblems1x/clan-icon-v2-${clanData[id]?.clan?.emblem_set_id}.png`
: undefined
}
description={`Tier ${
TIER_ROMAN_NUMERALS[tier as Tier]
} tanks • ${new Date().toDateString()}`}
description={`Tier ${TIER_ROMAN_NUMERALS[tier as Tier]} tanks`}
/>
{filteredTanks.length === 0 && <NoData type={NoDataType.TanksFound} />}
+1 -2
View File
@@ -513,8 +513,7 @@ export const ratingsCommand = new Promise<CommandRegistryRaw>(
<TitleBar
name={titleName}
image={titleImage}
nameDiscriminator={titleNameDiscriminator}
description={`${titleDescription} • ${new Date().toDateString()}`}
description={titleDescription}
/>
{items && (
+1 -2
View File
@@ -1,5 +1,4 @@
import { Percentile } from '../../../constants/percentiles';
import { TankType } from '../../../core/blitz/tankopedia';
import { theme } from '../../../stitches.config';
import { TREE_TYPE_ICONS, TreeTypeEnum } from '../../Tanks';
import { RowStat } from './RowStat';
@@ -17,7 +16,7 @@ interface RowProps {
title: string;
minimized?: boolean;
treeType?: TreeTypeEnum;
tankType?: TankType;
tankType?: string;
stats: (RowStatItem | undefined)[];
}
@@ -34,6 +34,8 @@ export default async function normalizeInteractionReturnable(
} else if (item instanceof AttachmentBuilder) {
if (!reply.files) reply.files = [];
reply.files.push(item);
} else if (item === null) {
return;
} else {
const image = await jsxToPng(item);
if (!reply.files) reply.files = [];
+2 -4
View File
@@ -13,11 +13,10 @@ import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand';
import { AccountInfo } from '../types/accountInfo';
import { Histories } from '../types/histories';
import { PlayerClanInfo } from '../types/playerClanData';
import { StatType } from './stats';
export default async function evolution<Type extends StatType>(
type: Type,
{ start, end, evolutionName }: ResolvedPeriod,
{ start, end, name }: ResolvedPeriod,
{ region: server, id }: ResolvedPlayer,
tankId: Type extends 'tank' ? number : null,
) {
@@ -84,9 +83,8 @@ export default async function evolution<Type extends StatType>(
<Wrapper>
<TitleBar
name={accountInfo[id].nickname}
nameDiscriminator={nameDiscriminator}
image={image}
description={`${evolutionName} • ${new Date().toDateString()}`}
description={name}
/>
{/* goofy ahh bug forces me to call them as functions */}
+1 -4
View File
@@ -192,15 +192,12 @@ export default async function today(
<Wrapper>
<TitleBar
name={accountInfo[id].nickname}
nameDiscriminator={
clanData[id]?.clan ? `[${clanData[id]?.clan?.tag}]` : undefined
}
image={
clanData[id]?.clan
? `https://wotblitz-gc.gcdn.co/icons/clanEmblems1x/clan-icon-v2-${clanData[id]?.clan?.emblem_set_id}.png`
: undefined
}
description={`Today's breakdown • ${new Date().toDateString()}`}
description="Today's breakdown"
/>
{rows.length === 0 && <NoData type={NoDataType.BattlesInPeriod} />}