mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
fix(app): remove stale DM list gaps (#1583)
This commit is contained in:
1 parent
614ee3a54b
commit
09ea748479
1 file changed
+6
-1
@@ -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];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user