From 0258c5aac23bd285fba9a93c8bac2db44ff0a9a5 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 30 Jul 2024 13:22:48 -0400 Subject: [PATCH] Releasing Flows if not subscribed anymore. --- .../amethyst/ui/screen/loggedIn/AccountViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt index f97ae42bf..fbbb88a3d 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt @@ -317,7 +317,7 @@ class AccountViewModel( }.flowOn(Dispatchers.Default) .stateIn( viewModelScope, - SharingStarted.Eagerly, + SharingStarted.WhileSubscribed(10000, 10000), NoteComposeReportState(), ).also { noteIsHiddenFlows.put(note, it) @@ -334,7 +334,7 @@ class AccountViewModel( .map { it.note.relays.size > 3 } .stateIn( viewModelScope, - SharingStarted.Eagerly, + SharingStarted.WhileSubscribed(10000, 10000), note.relays.size > 3, ).also { noteMustShowExpandButtonFlows.put(note, it)