From 63654b742a6deff4d0c62dabe64fa2b6db856bf5 Mon Sep 17 00:00:00 2001 From: KotlinGeekDev Date: Thu, 31 Oct 2024 16:52:34 +0100 Subject: [PATCH] Refactor NostrUserFollowSetFeedViewModel to use the FollowSetViewModel. Change follow sets signature. Might be changed later. --- .../src/main/java/com/vitorpamplona/amethyst/model/User.kt | 4 +--- .../com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/User.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/User.kt index fdcf65915..03e9a8afd 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/User.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/User.kt @@ -45,8 +45,6 @@ import com.vitorpamplona.quartz.events.MetadataEvent import com.vitorpamplona.quartz.events.ReportEvent import com.vitorpamplona.quartz.events.UserMetadata import com.vitorpamplona.quartz.events.toImmutableListOfLists -import kotlinx.collections.immutable.ImmutableList -import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentSetOf import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableStateFlow @@ -62,7 +60,7 @@ class User( var latestMetadataRelay: String? = null var latestContactList: ContactListEvent? = null var latestBookmarkList: BookmarkListEvent? = null - var followSets: ImmutableList = persistentListOf() + val followSets: MutableList = mutableListOf() var reports = mapOf>() private set diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt index b1e5e5151..769e782f6 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt @@ -51,6 +51,7 @@ import com.vitorpamplona.amethyst.ui.dal.UserProfileNewThreadFeedFilter import com.vitorpamplona.amethyst.ui.dal.UserProfileReportsFeedFilter import com.vitorpamplona.amethyst.ui.feeds.FeedContentState import com.vitorpamplona.amethyst.ui.feeds.InvalidatableContent +import com.vitorpamplona.amethyst.ui.screen.loggedIn.lists.FollowSetFeedViewModel import com.vitorpamplona.quartz.events.ChatroomKey import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job @@ -218,7 +219,7 @@ class NostrBookmarkPrivateFeedViewModel( class NostrUserFollowSetFeedViewModel( val account: Account, -) : FeedViewModel(FollowSetFeedFilter(account)) { +) : FollowSetFeedViewModel(FollowSetFeedFilter(account)) { class Factory( val account: Account, ) : ViewModelProvider.Factory {