mirror of
https://github.com/NohamR/lanyard-profile-readme.git
synced 2026-05-25 12:27:16 +00:00
Update renderCard.tsx
hotfix for null clan info
This commit is contained in:
@@ -109,7 +109,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
|
|||||||
}
|
}
|
||||||
|
|
||||||
let clanBadge: string;
|
let clanBadge: string;
|
||||||
if (data.discord_user.clan) {
|
if (data.discord_user.clan.) {
|
||||||
clanBadge = await encodeBase64(
|
clanBadge = await encodeBase64(
|
||||||
`https://cdn.discordapp.com/clan-badges/${data.discord_user.clan.identity_guild_id}/${data.discord_user.clan.badge}.png?size=16`
|
`https://cdn.discordapp.com/clan-badges/${data.discord_user.clan.identity_guild_id}/${data.discord_user.clan.badge}.png?size=16`
|
||||||
);
|
);
|
||||||
@@ -242,7 +242,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
|
|||||||
}
|
}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
${hideClan ? "" : `
|
${hideClan || !data.discord_user.clan.tag && !data.discord_user.clan.badge ? "" : `
|
||||||
<span style="
|
<span style="
|
||||||
background-color: ${clanBackgroundColor};
|
background-color: ${clanBackgroundColor};
|
||||||
border-radius: 0.375rem;
|
border-radius: 0.375rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user