fix(app): keep unread channel opens anchored to the divider

This commit is contained in:
Hampus authored and GitHub committed 2026-08-27 02:02:45 +02:00
1 parent 8e17970632
commit d3976e33f8
8 files changed
+223 -7

No files matched your search

@@ -457,6 +457,9 @@ class ReadStates {
this.refreshUnreadEstimate(state);
} else if (action.isAfter && state.ackMessageId != null && messages.has(state.ackMessageId, true)) {
state.unreadCount += action.messages.length;
if (state.oldestUnreadMessageId == null) {
state.rebuild();
}
}
this.notifyChange(action.channelId);
}
@@ -533,6 +536,7 @@ class ReadStates {
}
handleMessageDelete(action: {channelId: string}): void {
this.getIfExists(action.channelId)?.rebuild();
this.notifyChange(action.channelId);
}
@@ -280,7 +280,7 @@ export class ReadStateEntry {
} else {
this.unreadCount = loadedUnreadCount;
}
this.oldestUnreadMessageId = hasUnreadBoundary ? (this.storedOldestUnreadMessageId ?? oldestUnread) : null;
this.oldestUnreadMessageId = this.storedOldestUnreadMessageId ?? oldestUnread;
}
shouldMentionFor(message: MessageModel | WireMessage, userId: string, isPrivate: boolean): boolean {