Skip to content

Commit 0b4469d

Browse files
committed
Fix placeholder chars
1 parent f42ea50 commit 0b4469d

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

pages/characters/[char].tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,14 +456,16 @@ export async function getStaticProps(context: GetStaticPropsContext): Promise<Ge
456456
const curves = await getCharacterCurves()
457457
if (curves)
458458
characterCurves = Object.fromEntries(char.curves.map(c => c.curve).filter((v, i, arr) => arr.indexOf(v) == i).map(c => [c, curves[c]])) as CharacterCurves
459+
}
459460

461+
if (char.skills)
460462
neededTemplates.push(...char.skills.flatMap(s => {
461463
const templates = s.talents?.flatMap(t => t.costs?.template ?? []) ?? []
462464
if (s.ult?.costs?.template)
463465
templates.push(s.ult.costs.template)
464466
return templates
465467
}))
466-
}
468+
467469

468470
let costTemplates = {}
469471
if (char.ascensionCosts) {

public/img/unknown.png

9.6 KB
Loading

utils/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export function isInCosts(template: CostTemplate | Cost[], costTemplates: CostTe
117117

118118

119119
export function image(type: string, name: string, ext = "png"): string {
120+
if (name == "Unknown") return "/img/unknown.png"
120121
return `/img/${type}/${name.replace(/[:\-,'"]/g, "").replace(/ +/g, "_")}.${ext}`
121122
}
122123

0 commit comments

Comments
 (0)