fix: Mark story as read

In some cases stories are not marked as read
for example if the last story got redacted.
This is fixed now.
This commit is contained in:
Krille Fear 2022-03-20 14:45:47 +01:00
parent 55c82fb243
commit 033b71cab6

View File

@ -457,12 +457,13 @@ class StoryPageController extends State<StoryPage> {
final currentEvent = this.currentEvent;
if (currentEvent == null) return;
final room = currentEvent.room;
room.client.updateIosBadge();
if (index == events.length - 1) {
timeline!.setReadMarker();
return;
}
if (!currentSeenByUsers.any((u) => u.id == u.room.client.userID)) {
room.setReadMarker(
currentEvent.eventId,
mRead: currentEvent.eventId,
);
room.client.updateIosBadge();
timeline!.setReadMarker(currentEvent.eventId);
}
}