ChannelTabs: Fix Render Issue

This commit is contained in:
thororen1234 2025-11-21 03:05:05 -05:00
parent d325128806
commit 5ec8c07380
No known key found for this signature in database

View file

@ -137,11 +137,17 @@ function ChannelTabContent(props: ChannelTabsProps & {
showStatusIndicators
} = settings.use(["noPomeloNames", "showStatusIndicators"]);
const [isTyping] = useStateFromStores(
[TypingStore],
() => [
!!((Object.keys(TypingStore.getTypingUsers(props.channelId)) as string[]).filter(id => id !== userId).length)
]
const [isTyping, status, isMobile] = useStateFromStores(
[TypingStore, PresenceStore],
() => {
const recipientId = recipients?.[0] ?? "";
return [
!!((Object.keys(TypingStore.getTypingUsers(props.channelId)) as string[]).filter(id => id !== userId).length),
PresenceStore.getStatus(recipientId),
PresenceStore.isMobileOnline(recipientId)
];
}
);
if (guild) {
@ -183,17 +189,6 @@ function ChannelTabContent(props: ChannelTabsProps & {
}
}
if (!recipients) return null;
const [status, isMobile] = useStateFromStores(
[PresenceStore],
() => [
PresenceStore.getStatus(recipients[0]) as string,
PresenceStore.isMobileOnline(recipients[0]) as boolean
]
);
if (channel && recipients?.length) {
if (recipients.length === 1) {
const user = UserStore.getUser(recipients[0]) as User & { globalName: string; };