From f27c8811d579de97328246e150437a5f35e234aa Mon Sep 17 00:00:00 2001 From: nrobi144 Date: Mon, 23 Mar 2026 14:31:59 +0200 Subject: [PATCH] fix(cache): don't reset followersCount to 0 on subscription restart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cached value now stays visible until relay data exceeds it, preventing the count jumping from cached→0→ticking back up on each navigation. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../com/vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt index 32ea06258..0c9582151 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt @@ -307,9 +307,8 @@ fun UserProfileScreen( // Subscribe to followers (contact lists that tag this user) rememberSubscription(connectedRelays, pubKeyHex, retryTrigger, relayManager = relayManager) { if (connectedRelays.isNotEmpty()) { - // Clear previous followers when subscription restarts + // Clear dedup set but keep cached followersCount visible until new data arrives followerAuthors.clear() - followersCount = 0 SubscriptionConfig( subId = "followers-${pubKeyHex.take(8)}-${System.currentTimeMillis()}",