chore: Scroll to unread thread if last message is from a thread

pull/2326/head
krille-chan 2 months ago
parent a2c88af69b
commit 97fe704f5a
No known key found for this signature in database

@ -354,7 +354,12 @@ class ChatController extends State<ChatPageWithRoom>
);
sendingClient = Matrix.of(context).client;
readMarkerEventId = room.hasNewMessages ? room.fullyRead : '';
final lastEventThreadId =
room.lastEvent?.relationshipType == RelationshipTypes.thread
? room.lastEvent?.relationshipEventId
: null;
readMarkerEventId =
room.hasNewMessages ? lastEventThreadId ?? room.fullyRead : '';
WidgetsBinding.instance.addObserver(this);
_tryLoadTimeline();
if (kIsWeb) {
@ -387,7 +392,11 @@ class ChatController extends State<ChatPageWithRoom>
loadTimelineFuture = _getTimeline();
try {
await loadTimelineFuture;
if (initialEventId != null) scrollToEventId(initialEventId);
// We launched the chat with a given initial event ID:
if (initialEventId != null) {
scrollToEventId(initialEventId);
return;
}
var readMarkerEventIndex = readMarkerEventId.isEmpty
? -1

Loading…
Cancel
Save