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 869d4ba11..b5f2626a3 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,7 +51,7 @@ import com.vitorpamplona.amethyst.ui.dal.ThreadFeedFilter import com.vitorpamplona.amethyst.ui.feeds.FeedContentState import com.vitorpamplona.amethyst.ui.feeds.FeedState import com.vitorpamplona.amethyst.ui.feeds.InvalidatableContent -import com.vitorpamplona.amethyst.ui.screen.loggedIn.lists.FollowSetFeedViewModel +import com.vitorpamplona.amethyst.ui.screen.loggedIn.lists.NostrListFeedViewModel import com.vitorpamplona.quartz.nip17Dm.base.ChatroomKey import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -163,13 +163,13 @@ class NostrBookmarkPrivateFeedViewModel( } @Stable -class NostrUserFollowSetFeedViewModel( +class NostrUserListFeedViewModel( val account: Account, -) : FollowSetFeedViewModel(FollowSetFeedFilter(account)) { +) : NostrListFeedViewModel(FollowSetFeedFilter(account)) { class Factory( val account: Account, ) : ViewModelProvider.Factory { - override fun create(modelClass: Class): NostrUserFollowSetFeedViewModel = NostrUserFollowSetFeedViewModel(account) as NostrUserFollowSetFeedViewModel + override fun create(modelClass: Class): NostrUserFollowSetFeedViewModel = NostrUserListFeedViewModel(account) as NostrUserFollowSetFeedViewModel } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/CustomListsScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/CustomListsScreen.kt index 0c9b8a608..68b19bf22 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/CustomListsScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/CustomListsScreen.kt @@ -65,7 +65,7 @@ import com.vitorpamplona.amethyst.ui.feeds.LoadingFeed import com.vitorpamplona.amethyst.ui.feeds.RefresheableBox import com.vitorpamplona.amethyst.ui.navigation.INav import com.vitorpamplona.amethyst.ui.navigation.TopBarWithBackButton -import com.vitorpamplona.amethyst.ui.screen.NostrUserFollowSetFeedViewModel +import com.vitorpamplona.amethyst.ui.screen.NostrUserListFeedViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.DisappearingScaffold import com.vitorpamplona.amethyst.ui.stringRes @@ -83,10 +83,10 @@ fun ListsScreen( accountViewModel: AccountViewModel, nav: INav, ) { - val followSetsViewModel: NostrUserFollowSetFeedViewModel = + val followSetsViewModel: NostrUserListFeedViewModel = viewModel( - key = "NostrUserFollowSetFeedViewModel", - factory = NostrUserFollowSetFeedViewModel.Factory(accountViewModel.account), + key = "NostrUserListFeedViewModel", + factory = NostrUserListFeedViewModel.Factory(accountViewModel.account), ) val currentCoroutineScope = rememberCoroutineScope() diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/FollowSetFeedViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/NostrListFeedViewModel.kt similarity index 96% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/FollowSetFeedViewModel.kt rename to amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/NostrListFeedViewModel.kt index ebf33560f..7c84c2747 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/FollowSetFeedViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/NostrListFeedViewModel.kt @@ -43,7 +43,8 @@ import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch -abstract class FollowSetFeedViewModel( +// TODO: Investigate the addition of feed filters, for bookmark sets and general ones. +abstract class NostrListFeedViewModel( val dataSource: FeedFilter, ) : ViewModel(), InvalidatableContent { @@ -86,7 +87,7 @@ abstract class FollowSetFeedViewModel( } } catch (e: Exception) { Log.e( - "FollowSetFeedViewModel", + "NostrListFeedViewModel", "refreshSuspended: Error loading or refreshing feed -> ${e.message}", ) _feedContent.update { FollowSetState.FeedError(e.message.toString()) }