From 5b51e97594f428babfb2c8a600f5861398246d4b Mon Sep 17 00:00:00 2001 From: KotlinGeekDev Date: Wed, 30 Oct 2024 14:57:27 +0100 Subject: [PATCH] Replace TODOs with provided feed state implementations. --- .../ui/screen/loggedIn/lists/CustomListsScreen.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 73ee60208..b22e8f18e 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 @@ -53,7 +53,10 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.viewmodel.compose.viewModel import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.model.Note +import com.vitorpamplona.amethyst.ui.feeds.FeedEmpty +import com.vitorpamplona.amethyst.ui.feeds.FeedError import com.vitorpamplona.amethyst.ui.feeds.FeedState +import com.vitorpamplona.amethyst.ui.feeds.LoadingFeed import com.vitorpamplona.amethyst.ui.navigation.INav import com.vitorpamplona.amethyst.ui.navigation.TopBarWithBackButton import com.vitorpamplona.amethyst.ui.screen.NostrUserFollowSetFeedViewModel @@ -114,15 +117,20 @@ fun CustomListsScreen( }, ) { when (followSetsState) { - FeedState.Empty -> TODO() - is FeedState.FeedError -> TODO() + FeedState.Empty -> FeedEmpty { followSetsViewModel.invalidateData() } + is FeedState.FeedError -> + FeedError( + (followSetsState as FeedState.FeedError).errorMessage, + ) { + followSetsViewModel.invalidateData() + } is FeedState.Loaded -> { FollowListLoaded( nostrSigner = accountViewModel.account.signer, loadedFeedState = followSetsState as FeedState.Loaded, ) } - FeedState.Loading -> TODO() + FeedState.Loading -> LoadingFeed() } } }