serverProfile: fix crash with lurked guilds

Co-authored-by: aamiaa <9750071+aamiaa@users.noreply.github.com>
This commit is contained in:
Vendicated 2023-10-08 03:49:00 +02:00
parent ac1b67ccbd
commit c33d59b45d
No known key found for this signature in database
GPG Key ID: D66986BAF75ECF18
2 changed files with 2 additions and 2 deletions

View File

@ -170,7 +170,7 @@ function ServerInfoTab({ guild }: GuildProps) {
const Fields = {
"Server Owner": owner ? Owner(guild.id, owner) : "Loading...",
"Created At": renderTimestamp(SnowflakeUtils.extractTimestamp(guild.id)),
"Joined At": renderTimestamp(guild.joinedAt.getTime()),
"Joined At": guild.joinedAt ? renderTimestamp(guild.joinedAt.getTime()) : "-", // Not available in lurked guild
"Vanity Link": guild.vanityURLCode ? (<a>{`discord.gg/${guild.vanityURLCode}`}</a>) : "-", // Making the anchor href valid would cause Discord to reload
"Preferred Locale": guild.preferredLocale || "-",
"Verification Level": ["None", "Low", "Medium", "High", "Highest"][guild.verificationLevel] || "?",

View File

@ -18,7 +18,7 @@ const Patch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild;
group?.push(
<Menu.MenuItem
id="vc-server-profile"
label="Server Profile"
label="Server Info"
action={() => openGuildProfileModal(guild)}
/>
);