serverProfile: fix crash with lurked guilds
Co-authored-by: aamiaa <9750071+aamiaa@users.noreply.github.com>
This commit is contained in:
parent
ac1b67ccbd
commit
c33d59b45d
2 changed files with 2 additions and 2 deletions
|
@ -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] || "?",
|
||||||
|
|
|
@ -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)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue