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 = { const Fields = {
"Server Owner": owner ? Owner(guild.id, owner) : "Loading...", "Server Owner": owner ? Owner(guild.id, owner) : "Loading...",
"Created At": renderTimestamp(SnowflakeUtils.extractTimestamp(guild.id)), "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 "Vanity Link": guild.vanityURLCode ? (<a>{`discord.gg/${guild.vanityURLCode}`}</a>) : "-", // Making the anchor href valid would cause Discord to reload
"Preferred Locale": guild.preferredLocale || "-", "Preferred Locale": guild.preferredLocale || "-",
"Verification Level": ["None", "Low", "Medium", "High", "Highest"][guild.verificationLevel] || "?", "Verification Level": ["None", "Low", "Medium", "High", "Highest"][guild.verificationLevel] || "?",

View file

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