Skip to content

Commit e6983db

Browse files
committed
fix: hopefully fix user icon missing issue
1 parent 4ef3440 commit e6983db

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/pages/user/[user].astro

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ for (const submission of submissions) {
7474
7575
let modrinthUserIcon = "/images/unknown_user.png";
7676
if (userData.modrinth_id) {
77-
var modrinthUser = await getModrinthUser(userData.modrinth_id);
78-
if (modrinthUser) {
77+
const modrinthUser = await getModrinthUser(userData.modrinth_id);
78+
if (modrinthUser && modrinthUser.avatar_url) {
7979
modrinthUserIcon = modrinthUser.avatar_url;
8080
}
8181
}
@@ -93,9 +93,7 @@ let bio =
9393
<div class="flex border-0 border-b-4 border-leaf-200">
9494
<span
9595
class="mr-5 aspect-square w-16 bg-cover bg-center"
96-
style={modrinthUserIcon
97-
? `background-image: url(${modrinthUserIcon});`
98-
: ""}
96+
style=`background-image: url(${modrinthUserIcon});`
9997
>
10098
</span>
10199
<h1 class="mt-5 text-xl font-bold text-black dark:text-white">

0 commit comments

Comments
 (0)