mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-28 21:53:01 +02:00
Migrates top nav list to hashtag, geohash and community lists
This commit is contained in:
@@ -66,7 +66,6 @@ import kotlinx.coroutines.flow.SharingStarted
|
|||||||
import kotlinx.coroutines.flow.combineTransform
|
import kotlinx.coroutines.flow.combineTransform
|
||||||
import kotlinx.coroutines.flow.flowOn
|
import kotlinx.coroutines.flow.flowOn
|
||||||
import kotlinx.coroutines.flow.stateIn
|
import kotlinx.coroutines.flow.stateIn
|
||||||
import kotlinx.coroutines.flow.transformLatest
|
|
||||||
|
|
||||||
@Stable
|
@Stable
|
||||||
class FollowListState(
|
class FollowListState(
|
||||||
@@ -160,12 +159,12 @@ class FollowListState(
|
|||||||
|
|
||||||
@OptIn(ExperimentalCoroutinesApi::class)
|
@OptIn(ExperimentalCoroutinesApi::class)
|
||||||
val liveKind3FollowsFlow: Flow<List<FeedDefinition>> =
|
val liveKind3FollowsFlow: Flow<List<FeedDefinition>> =
|
||||||
account.kind3FollowList.flow.transformLatest {
|
combineTransform(account.kind3FollowList.flow, account.hashtagList.flow, account.geohashList.flow, account.communityList.flow) { kind3List, hashtagList, geotagList, communityList ->
|
||||||
checkNotInMainThread()
|
checkNotInMainThread()
|
||||||
|
|
||||||
val communities =
|
val communities =
|
||||||
it.communities.mapNotNull {
|
communityList.mapNotNull {
|
||||||
LocalCache.checkGetOrCreateAddressableNote(it)?.let { communityNote ->
|
LocalCache.getOrCreateAddressableNote(it.address).let { communityNote ->
|
||||||
TagFeedDefinition(
|
TagFeedDefinition(
|
||||||
"Community/${communityNote.idHex}",
|
"Community/${communityNote.idHex}",
|
||||||
CommunityName(communityNote),
|
CommunityName(communityNote),
|
||||||
@@ -178,7 +177,7 @@ class FollowListState(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val hashtags =
|
val hashtags =
|
||||||
it.hashtags.map {
|
hashtagList.map {
|
||||||
TagFeedDefinition(
|
TagFeedDefinition(
|
||||||
"Hashtag/$it",
|
"Hashtag/$it",
|
||||||
HashtagName(it),
|
HashtagName(it),
|
||||||
@@ -190,7 +189,7 @@ class FollowListState(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val geotags =
|
val geotags =
|
||||||
it.geotags.map {
|
geotagList.map {
|
||||||
TagFeedDefinition(
|
TagFeedDefinition(
|
||||||
"Geohash/$it",
|
"Geohash/$it",
|
||||||
GeoHashName(it),
|
GeoHashName(it),
|
||||||
|
Reference in New Issue
Block a user