From 99d9149ef90aea2cb6f0e0fb554b1c8cc6bbf391 Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Fri, 19 Nov 2021 14:57:56 +0100 Subject: [PATCH] fix: Only mark unread if actually marked --- lib/pages/chat/chat.dart | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index f22a534e..77b0bbef 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -169,13 +169,7 @@ class ChatController extends State { timeline = await room.getTimeline(onUpdate: updateView); if (timeline.events.isNotEmpty) { // ignore: unawaited_futures - room.markUnread(false).catchError((err) { - if (err is MatrixException && err.errcode == 'M_FORBIDDEN') { - // ignore if the user is not in the room (still joining) - return; - } - throw err; - }); + if (room.markedUnread) room.markUnread(false); } // when the scroll controller is attached we want to scroll to an event id, if specified