From 0560088796ff8e6752b7947e93602e0d940eb995 Mon Sep 17 00:00:00 2001 From: "maarten.vercruysse" Date: Thu, 14 Sep 2023 18:33:37 +0200 Subject: [PATCH] Fix unread count not resetting when swapping to anon --- app/src/main/java/com/jerboa/model/SiteViewModel.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/jerboa/model/SiteViewModel.kt b/app/src/main/java/com/jerboa/model/SiteViewModel.kt index c4b626da4..2e89b8e24 100644 --- a/app/src/main/java/com/jerboa/model/SiteViewModel.kt +++ b/app/src/main/java/com/jerboa/model/SiteViewModel.kt @@ -66,6 +66,8 @@ class SiteViewModel(private val accountRepository: AccountRepository) : ViewMode if (!it.isAnon()) { fetchUnreadCounts(GetUnreadCount(auth = it.jwt)) + } else { // Reset the unread count if we're anonymous + unreadCountRes = ApiState.Empty } } }