chore: Scroll to unread thread if last message is from a thread
This commit is contained in:
parent
a2c88af69b
commit
97fe704f5a
1 changed files with 11 additions and 2 deletions
|
|
@ -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…
Add table
Reference in a new issue