hide subscription dvms for now

This commit is contained in:
Believethehype
2024-05-13 18:17:36 +02:00
parent 334b948900
commit fe45e188bd
3 changed files with 27 additions and 17 deletions
@@ -528,7 +528,6 @@ data class DVMCard(
val name: String,
val description: String?,
val cover: String?,
val moderators: ImmutableList<Participant>,
)
@Composable
@@ -749,7 +748,6 @@ fun RenderContentDVMThumb(
name = noteEvent?.appMetaData()?.name ?: "",
description = noteEvent?.appMetaData()?.about ?: "",
cover = noteEvent?.appMetaData()?.image?.ifBlank { null },
moderators = persistentListOf(),
)
}
.distinctUntilChanged()
@@ -758,7 +756,6 @@ fun RenderContentDVMThumb(
name = noteEvent.appMetaData()?.name ?: "",
description = noteEvent.appMetaData()?.about ?: "",
cover = noteEvent.appMetaData()?.image?.ifBlank { null },
moderators = persistentListOf(),
),
)
@@ -43,7 +43,7 @@ object ScrollStateKeys {
val HOME_FOLLOWS = Route.Home.base + "Follows"
val HOME_REPLIES = Route.Home.base + "FollowsReplies"
val DISCOVER_CONTENT = Route.Home.base + "Content"
val DISCOVER_CONTENT = Route.Home.base + "DiscoverContent"
val DISCOVER_MARKETPLACE = Route.Home.base + "Marketplace"
val DISCOVER_LIVE = Route.Home.base + "Live"
val DISCOVER_COMMUNITY = Route.Home.base + "Communities"
@@ -112,7 +112,7 @@ fun DiscoverScreen(
TabItem(
R.string.discover_content,
discoveryContentNIP89FeedViewModel,
Route.Discover.base + "Content",
Route.Discover.base + "DiscoverContent",
ScrollStateKeys.DISCOVER_CONTENT,
AppDefinitionEvent.KIND,
),
@@ -152,6 +152,7 @@ fun DiscoverScreen(
val pagerState = rememberForeverPagerState(key = PagerStateKeys.DISCOVER_SCREEN) { tabs.size }
WatchAccountForDiscoveryScreen(
discoverNIP89FeedViewModel = discoveryContentNIP89FeedViewModel,
discoverMarketplaceFeedViewModel = discoveryMarketplaceFeedViewModel,
discoveryLiveFeedViewModel = discoveryLiveFeedViewModel,
discoveryCommunityFeedViewModel = discoveryCommunityFeedViewModel,
@@ -320,6 +321,7 @@ private fun RenderDiscoverFeed(
@Composable
fun WatchAccountForDiscoveryScreen(
discoverNIP89FeedViewModel: NostrDiscoverNIP89FeedViewModel,
discoverMarketplaceFeedViewModel: NostrDiscoverMarketplaceFeedViewModel,
discoveryLiveFeedViewModel: NostrDiscoverLiveFeedViewModel,
discoveryCommunityFeedViewModel: NostrDiscoverCommunityFeedViewModel,
@@ -330,6 +332,7 @@ fun WatchAccountForDiscoveryScreen(
LaunchedEffect(accountViewModel, listState) {
NostrDiscoveryDataSource.resetFilters()
discoverNIP89FeedViewModel.checkKeysInvalidateDataAndSendToTop()
discoverMarketplaceFeedViewModel.checkKeysInvalidateDataAndSendToTop()
discoveryLiveFeedViewModel.checkKeysInvalidateDataAndSendToTop()
discoveryCommunityFeedViewModel.checkKeysInvalidateDataAndSendToTop()
@@ -354,6 +357,15 @@ private fun DiscoverFeedLoaded(
itemsIndexed(state.feed.value, key = { _, item -> item.idHex }) { _, item ->
val defaultModifier = remember { Modifier.fillMaxWidth().animateItemPlacement() }
// TODO For now we avoid subscription based DVMs, as we need logic for these first if a user is not subscribed already.
var avoid = false
if (item.event is AppDefinitionEvent) {
if ((item.event as AppDefinitionEvent).appMetaData()?.subscription == true) {
avoid = true
}
}
// TODO End
if (!avoid) {
Row(defaultModifier) {
ChannelCardCompose(
baseNote = item,
@@ -370,6 +382,7 @@ private fun DiscoverFeedLoaded(
)
}
}
}
}
@OptIn(ExperimentalFoundationApi::class)