Ghosted: Hopefully fix

This commit is contained in:
thororen1234 2026-02-05 13:43:11 -05:00
parent 8f0db742ec
commit 7eddd50923
No known key found for this signature in database
2 changed files with 5 additions and 5 deletions

View file

@ -29,7 +29,7 @@ function GroupDmsIcon({ channel }: { channel: Channel; }) {
size="SIZE_40"
aria-label={channel?.name || "Unnamed Group"}
/> : <GroupDmsRecipientsIcon
recipients={channel.recipients}
recipients={channel?.recipients ?? []}
size="SIZE_40"
isTyping={null}
/>;
@ -51,7 +51,7 @@ export function getChannelDisplayName(channelId: string): string {
}
// 1-on-1 DM
const recipientId = channel.recipients?.[0];
const recipientId = channel?.recipients?.[0] ?? "";
const user = UserStore.getUser(recipientId);
return user?.username || "Unknown User";
}
@ -115,6 +115,7 @@ export function GhostedUsersModal({ modalProps, ghostedChannels: initialChannels
const lastMessageDate = lastMessage?.timestamp ? formatMessageDate(lastMessage.timestamp) : "";
const displayName = getChannelDisplayName(channel.id);
const userId = channel?.recipients?.[0] ?? "";
return (
<div
key={channelId}
@ -125,7 +126,7 @@ export function GhostedUsersModal({ modalProps, ghostedChannels: initialChannels
<GroupDmsIcon
channel={channel}
/> : <Avatar
src={UserStore.getUser(channel.recipients?.[0])?.getAvatarURL(undefined, 128, true) || ""}
src={UserStore.getUser(userId)?.getAvatarURL(undefined, 128, true)}
size="SIZE_40"
aria-label={displayName}
/>}

View file

@ -8,7 +8,7 @@ import "./styles.css";
import { findGroupChildrenByChildId } from "@api/ContextMenu";
import { addServerListElement, removeServerListElement, ServerListRenderPosition } from "@api/ServerList";
import { definePluginSettings, migratePluginSettings } from "@api/Settings";
import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs, EquicordDevs } from "@utils/constants";
import { classNameFactory } from "@utils/css";
@ -132,7 +132,6 @@ function makeContextItem(props) {
/>;
}
migratePluginSettings("Ghosted", "Boo");
export default definePlugin({
name: "Ghosted",
description: "A cute ghost will appear if you don't answer their DMs",