fix: use ownerId for group DM detection in ChannelSidebar
members.length > 2 caused group DMs to lose their identity when a member left and only 2 remained. ownerId is the canonical marker set at group creation and persists through the group's lifecycle.
This commit is contained in:
@@ -492,7 +492,7 @@ export function ChannelSidebar() {
|
|||||||
{dmChannels.map((dm) => {
|
{dmChannels.map((dm) => {
|
||||||
const otherMembers = dm.members.filter(m => !isSelf(m, user));
|
const otherMembers = dm.members.filter(m => !isSelf(m, user));
|
||||||
if (otherMembers.length === 0) return null;
|
if (otherMembers.length === 0) return null;
|
||||||
const isGroup = dm.members.length > 2;
|
const isGroup = !!dm.ownerId;
|
||||||
const isDmUnread = unreadChannels.has(dm.id) && currentChannelId !== dm.id;
|
const isDmUnread = unreadChannels.has(dm.id) && currentChannelId !== dm.id;
|
||||||
|
|
||||||
const firstOtherDm = isGroup ? null : otherMembers[0];
|
const firstOtherDm = isGroup ? null : otherMembers[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user