diff --git a/fluxer_app/src/features/app/components/layout/GuildsLayout.tsx b/fluxer_app/src/features/app/components/layout/GuildsLayout.tsx index 7bf67e936..a139de73d 100644 --- a/fluxer_app/src/features/app/components/layout/GuildsLayout.tsx +++ b/fluxer_app/src/features/app/components/layout/GuildsLayout.tsx @@ -162,7 +162,12 @@ class DMChannelVisibilityController { } private projectVisibleChannels({currentChannels, unreadIds}: ProjectVisibleDMChannelsRequest): Array { - const leavingChannels = currentChannels.filter((channel) => !unreadIds.has(channel.id)); + const visibleChannelIds = new Set(this.orderedUnreadChannels.map(getChannelId)); + const leavingChannels = currentChannels.filter((channel) => { + if (unreadIds.has(channel.id) || visibleChannelIds.has(channel.id)) return false; + visibleChannelIds.add(channel.id); + return true; + }); for (const channel of leavingChannels) this.scheduleRemoval(channel.id); return [...this.orderedUnreadChannels, ...leavingChannels]; }