Skip to content

Commit fd83c86

Browse files
committed
Fix talents not showing for placeholders
1 parent a8e2ba8 commit fd83c86

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pages/characters/[char].tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import styles from "../style.module.css"
2020
interface Props {
2121
char: Character,
2222
characterCurves: CharacterCurves | null
23-
costTemplates: CostTemplates | null
23+
costTemplates: CostTemplates
2424
specialty: SpecialtyItem | null
2525
guides?: string[][]
2626
}
@@ -99,7 +99,7 @@ export default function CharacterWebpage({ char, location, characterCurves, cost
9999

100100
<div id="details">
101101
{char.ascensionCosts && <AscensionCosts costs={char.ascensionCosts} />}
102-
{char.skills && <TalentCosts skills={char.skills} />}
102+
{char.skills && getTalentCosts(char.skills).length > 0 && <TalentCosts talentCosts={getTalentCosts(char.skills)} />}
103103
{guides && guides.length > 0 && <Guides guides={guides} />}
104104
<div className="clear-both" />
105105
{isFullCharacter(char) && characterCurves && <Stats char={char} curves={characterCurves} />}
@@ -199,10 +199,10 @@ function getTalentCosts(skills: Skills[]): string[] {
199199
return [...books, ...mats, ...drops] as string[]
200200
}
201201

202-
function TalentCosts({ skills }: { skills: Skills[] }) {
202+
function TalentCosts({ talentCosts }: { talentCosts: string[] }) {
203203
return <div className="flex flex-wrap items-center">
204204
<div className="text-base font-semibold pt-1 inline-block pr-1 h-9">Talent materials:</div>
205-
{getTalentCosts(skills).map(e => <MaterialImage key={e} name={e} />)}
205+
{talentCosts.map(e => <MaterialImage key={e} name={e} />)}
206206
</div>
207207
}
208208

@@ -465,7 +465,7 @@ export async function getStaticProps(context: GetStaticPropsContext): Promise<Ge
465465
}))
466466
}
467467

468-
let costTemplates = null
468+
let costTemplates = {}
469469
if (char.ascensionCosts) {
470470
neededTemplates.push(char.ascensionCosts.template)
471471
}

0 commit comments

Comments
 (0)