fix(threads): light up joined threads in muted communities (#3316)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-08 20:32:33 +02:00
1 parent b146b8ee33
commit fdb7410976
2 files changed
+9 -2

No files matched your search

@@ -14,7 +14,7 @@ import {useThreadMenuData} from '@app/features/threads/hooks/useThreadMenuData';
import ChannelThreads from '@app/features/threads/state/ChannelThreads'; import ChannelThreads from '@app/features/threads/state/ChannelThreads';
import ThreadGuilds from '@app/features/threads/state/ThreadGuilds'; import ThreadGuilds from '@app/features/threads/state/ThreadGuilds';
import ThreadMemberships from '@app/features/threads/state/ThreadMemberships'; import ThreadMemberships from '@app/features/threads/state/ThreadMemberships';
import {isThreadMuted} from '@app/features/threads/utils/ThreadNotificationUtils'; import {isThreadMutedInSidebar} from '@app/features/threads/utils/ThreadNotificationUtils';
import * as ContextMenuCommands from '@app/features/ui/commands/ContextMenuCommands'; import * as ContextMenuCommands from '@app/features/ui/commands/ContextMenuCommands';
import {MentionBadge} from '@app/features/ui/components/MentionBadge'; import {MentionBadge} from '@app/features/ui/components/MentionBadge';
import {MenuBottomSheet} from '@app/features/ui/menu_bottom_sheet/MenuBottomSheet'; import {MenuBottomSheet} from '@app/features/ui/menu_bottom_sheet/MenuBottomSheet';
@@ -46,7 +46,7 @@ const ThreadMenuSheet = observer(({thread, onClose}: {thread: Channel; onClose:
const SidebarThreadRow = observer(({thread, isLast, isSelected}: SidebarThreadRowProps) => { const SidebarThreadRow = observer(({thread, isLast, isSelected}: SidebarThreadRowProps) => {
const [menuOpen, setMenuOpen] = useState(false); const [menuOpen, setMenuOpen] = useState(false);
const joined = ThreadMemberships.isMember(thread.id); const joined = ThreadMemberships.isMember(thread.id);
const muted = isThreadMuted(thread); const muted = isThreadMutedInSidebar(thread);
const mentionCount = ReadStates.getMentionCount(thread.id); const mentionCount = ReadStates.getMentionCount(thread.id);
const isUnread = joined && !muted && ReadStates.hasUnread(thread.id); const isUnread = joined && !muted && ReadStates.hasUnread(thread.id);
const handleClick = useCallback(() => openThreadFullView(thread), [thread]); const handleClick = useCallback(() => openThreadFullView(thread), [thread]);
@@ -24,6 +24,13 @@ export function isThreadParentMuted(thread: Channel): boolean {
return thread.parentId != null && UserGuildSettings.isMutedAtAnyLevel(thread.guildId ?? null, thread.parentId); return thread.parentId != null && UserGuildSettings.isMutedAtAnyLevel(thread.guildId ?? null, thread.parentId);
} }
export function isThreadMutedInSidebar(thread: Channel): boolean {
return (
ThreadMemberships.isMuted(thread.id) ||
(thread.parentId != null && UserGuildSettings.isChannelDirectlyMuted(thread.guildId ?? null, thread.parentId))
);
}
export function isThreadMuted(thread: Channel): boolean { export function isThreadMuted(thread: Channel): boolean {
return ThreadMemberships.isMuted(thread.id) || isThreadParentMuted(thread); return ThreadMemberships.isMuted(thread.id) || isThreadParentMuted(thread);
} }