From 08dd2d7d22103d39d2524929709f023d004f8218 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 15 May 2021 11:55:04 +0200 Subject: [PATCH] fix: Send read markers --- lib/views/chat.dart | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/views/chat.dart b/lib/views/chat.dart index ff795441..ea4ebbc7 100644 --- a/lib/views/chat.dart +++ b/lib/views/chat.dart @@ -160,17 +160,6 @@ class ChatController extends State { throw err; }); } - if (room.notificationCount != null && - room.notificationCount > 0 && - timeline != null && - timeline.events.isNotEmpty && - Matrix.of(context).webHasFocus) { - // ignore: unawaited_futures - room.sendReadMarker( - timeline.events.first.eventId, - readReceiptLocationEventId: timeline.events.first.eventId, - ); - } // when the scroll controller is attached we want to scroll to an event id, if specified // and update the scroll controller...which will trigger a request history, if the @@ -185,6 +174,17 @@ class ChatController extends State { }); } filteredEvents = timeline.getFilteredEvents(unfolded: unfolded); + if (room.notificationCount != null && + room.notificationCount > 0 && + timeline != null && + timeline.events.isNotEmpty && + Matrix.of(context).webHasFocus) { + // ignore: unawaited_futures + room.sendReadMarker( + timeline.events.first.eventId, + readReceiptLocationEventId: timeline.events.first.eventId, + ); + } return true; }