From 71dad0c69e7bb37c099af14d7a54203020ead771 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Sat, 18 Feb 2023 19:20:39 -0500 Subject: [PATCH] Fixes missing elements in the previous commit --- .../com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt index 24938d450..5d9d47697 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt @@ -15,6 +15,7 @@ import com.vitorpamplona.amethyst.ui.dal.HomeConversationsFeedFilter import com.vitorpamplona.amethyst.ui.dal.HomeNewThreadFeedFilter import com.vitorpamplona.amethyst.ui.dal.ThreadFeedFilter import com.vitorpamplona.amethyst.ui.dal.UserProfileNoteFeedFilter +import com.vitorpamplona.amethyst.ui.dal.UserProfileReportsFeedFilter import java.util.concurrent.atomic.AtomicBoolean import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -32,6 +33,7 @@ class NostrChatRoomFeedViewModel: FeedViewModel(ChatroomFeedFilter) class NostrGlobalFeedViewModel: FeedViewModel(GlobalFeedFilter) class NostrThreadFeedViewModel: FeedViewModel(ThreadFeedFilter) class NostrUserProfileFeedViewModel: FeedViewModel(UserProfileNoteFeedFilter) +class NostrUserProfileReportFeedViewModel: FeedViewModel(UserProfileReportsFeedFilter) class NostrChatroomListKnownFeedViewModel: FeedViewModel(ChatroomListKnownFeedFilter) class NostrChatroomListNewFeedViewModel: FeedViewModel(ChatroomListNewFeedFilter) class NostrHomeFeedViewModel: FeedViewModel(HomeNewThreadFeedFilter) @@ -42,12 +44,11 @@ abstract class FeedViewModel(val localFilter: FeedFilter): ViewModel() { private val _feedContent = MutableStateFlow(FeedState.Loading) val feedContent = _feedContent.asStateFlow() - open fun newListFromDataSource(): List { + fun newListFromDataSource(): List { return localFilter.loadTop() } fun refresh() { - println("Model Refresh: ${this::class.simpleName}") val scope = CoroutineScope(Job() + Dispatchers.Default) scope.launch { refreshSuspended() @@ -72,7 +73,6 @@ abstract class FeedViewModel(val localFilter: FeedFilter): ViewModel() { val scope = CoroutineScope(Job() + Dispatchers.Main) scope.launch { val currentState = feedContent.value - if (notes.isEmpty()) { _feedContent.update { FeedState.Empty } } else if (currentState is FeedState.Loaded) {