Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(app): remove stale DM list gaps (#1583)

Hampus09ea74847930
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<Channel> {
- 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];
}