Skip to content

Commit c692e44

Browse files
akabirumyabc
andcommitted
Use defined type instead of cast
Co-authored-by: Alexander Brandon Coles <[email protected]>
1 parent e525f78 commit c692e44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/components/primer/open_project/avatar_fallback.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ export class AvatarFallbackElement extends HTMLElement {
1010
// keeps its default gray fill defined in the source and no color override is applied.
1111
if (!this.uniqueId || !this.altText) return
1212

13-
const img = this.querySelector('img[src^="data:image/svg+xml"]')
13+
const img = this.querySelector<HTMLImageElement>('img[src^="data:image/svg+xml"]')
1414
if (!img) return
1515

1616
// Generate consistent color based on uniqueId and altText (hash must match OP Core)
1717
const text = `${this.uniqueId}${this.altText}`
1818
const hue = this.valueHash(text)
1919
const color = `hsl(${hue}, 50%, 30%)`
2020

21-
this.updateSvgColor(img as HTMLImageElement, color)
21+
this.updateSvgColor(img, color)
2222
}
2323

2424
/*

0 commit comments

Comments
 (0)