Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions client/sidebar/hooks/useRoomList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ export const useRoomList = (): Array<ISubscription> => {
const team = new Set();
const omnichannel = new Set();
const unread = new Set();
const _private = new Set();
const _public = new Set();
const channels = new Set();
const direct = new Set();
const discussion = new Set();
const conversation = new Set();
Expand All @@ -62,12 +61,8 @@ export const useRoomList = (): Array<ISubscription> => {
return discussion.add(room);
}

if (room.t === 'c') {
_public.add(room);
}

if (room.t === 'p') {
_private.add(room);
if (room.t === 'c' || room.t === 'p') {
channels.add(room);
}

if (room.t === 'l' && room.onHold) {
Expand Down Expand Up @@ -100,9 +95,8 @@ export const useRoomList = (): Array<ISubscription> => {
isDiscussionEnabled &&
discussion.size &&
groups.set('Discussions', discussion);
sidebarGroupByType && _private.size && groups.set('Private', _private);
sidebarGroupByType && _public.size && groups.set('Public', _public);
sidebarGroupByType && direct.size && groups.set('Direct', direct);
sidebarGroupByType && channels.size && groups.set('Channels', channels);
sidebarGroupByType && direct.size && groups.set('Direct_Messages', direct);
!sidebarGroupByType && groups.set('Conversations', conversation);
return [...groups.entries()].flatMap(([key, group]) => [key, ...group]);
});
Expand Down