discord: use placeholder if guild icon not available

also centers the invite on the form/user discord modal.
This commit is contained in:
Harvey Tindall
2023-06-19 17:48:24 +01:00
parent 765a749959
commit 094f7cea94
5 changed files with 15 additions and 4 deletions
+7 -1
View File
@@ -75,7 +75,13 @@ export class Discord {
const link = document.getElementById("discord-invite") as HTMLAnchorElement;
link.href = inv.invite;
link.target = "_blank";
link.innerHTML = `<span class="img-circle lg mr-4"><img class="img-circle" src="${inv.icon}" width="64" height="64"></span>${window.discordServerName}`;
if (inv.icon != "") {
link.innerHTML = `<span class="img-circle lg mr-4"><img class="img-circle" src="${inv.icon}" width="64" height="64"></span>${window.discordServerName}`;
} else {
link.innerHTML = `
<span class="shield mr-4 bg-discord"><i class="ri-discord-fill ri-xl text-white"></i></span>${window.discordServerName}
`;
}
});
private _checkVerified = () => {