Presubscribe to the bottom navigation items in the start up of the app.
This commit is contained in:
+1
-2
@@ -22,12 +22,11 @@ package com.vitorpamplona.amethyst.service.relayClient.reqCommand.account
|
|||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import com.vitorpamplona.amethyst.Amethyst
|
|
||||||
import com.vitorpamplona.amethyst.service.relayClient.KeyDataSourceSubscription
|
import com.vitorpamplona.amethyst.service.relayClient.KeyDataSourceSubscription
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AccountFilterAssemblerSubscription(accountViewModel: AccountViewModel) = AccountFilterAssemblerSubscription(accountViewModel, Amethyst.instance.sources.account)
|
fun AccountFilterAssemblerSubscription(accountViewModel: AccountViewModel) = AccountFilterAssemblerSubscription(accountViewModel, accountViewModel.dataSources().account)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AccountFilterAssemblerSubscription(
|
fun AccountFilterAssemblerSubscription(
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ import com.vitorpamplona.amethyst.ui.navigation.AppNavigation
|
|||||||
import com.vitorpamplona.amethyst.ui.navigation.Route
|
import com.vitorpamplona.amethyst.ui.navigation.Route
|
||||||
import com.vitorpamplona.amethyst.ui.screen.AccountStateViewModel
|
import com.vitorpamplona.amethyst.ui.screen.AccountStateViewModel
|
||||||
import com.vitorpamplona.amethyst.ui.screen.SharedPreferencesViewModel
|
import com.vitorpamplona.amethyst.ui.screen.SharedPreferencesViewModel
|
||||||
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.rooms.datasource.ChatroomListFilterAssemblerSubscription
|
||||||
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.discover.datasource.DiscoveryFilterAssemblerSubscription
|
||||||
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.home.datasource.HomeFilterAssemblerSubscription
|
||||||
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.video.datasource.VideoFilterAssemblerSubscription
|
||||||
import com.vitorpamplona.amethyst.ui.tor.TorServiceStatus
|
import com.vitorpamplona.amethyst.ui.tor.TorServiceStatus
|
||||||
import com.vitorpamplona.amethyst.ui.tor.TorType
|
import com.vitorpamplona.amethyst.ui.tor.TorType
|
||||||
import com.vitorpamplona.quartz.nip55AndroidSigner.NostrSignerExternal
|
import com.vitorpamplona.quartz.nip55AndroidSigner.NostrSignerExternal
|
||||||
@@ -83,6 +87,11 @@ fun LoggedInPage(
|
|||||||
// Loads account information from Relays.
|
// Loads account information from Relays.
|
||||||
AccountFilterAssemblerSubscription(accountViewModel)
|
AccountFilterAssemblerSubscription(accountViewModel)
|
||||||
|
|
||||||
|
HomeFilterAssemblerSubscription(accountViewModel)
|
||||||
|
ChatroomListFilterAssemblerSubscription(accountViewModel)
|
||||||
|
VideoFilterAssemblerSubscription(accountViewModel)
|
||||||
|
DiscoveryFilterAssemblerSubscription(accountViewModel)
|
||||||
|
|
||||||
// TODO: Is this needed?
|
// TODO: Is this needed?
|
||||||
RelaySubscriptionsCoordinatorSubscription()
|
RelaySubscriptionsCoordinatorSubscription()
|
||||||
|
|
||||||
|
|||||||
+8
@@ -25,6 +25,14 @@ import androidx.compose.runtime.remember
|
|||||||
import com.vitorpamplona.amethyst.service.relayClient.KeyDataSourceSubscription
|
import com.vitorpamplona.amethyst.service.relayClient.KeyDataSourceSubscription
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun ChatroomListFilterAssemblerSubscription(accountViewModel: AccountViewModel) {
|
||||||
|
ChatroomListFilterAssemblerSubscription(
|
||||||
|
accountViewModel.dataSources().chatroomList,
|
||||||
|
accountViewModel,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ChatroomListFilterAssemblerSubscription(
|
fun ChatroomListFilterAssemblerSubscription(
|
||||||
dataSource: ChatroomListFilterAssembler,
|
dataSource: ChatroomListFilterAssembler,
|
||||||
|
|||||||
+1
-1
@@ -57,7 +57,7 @@ fun MessagesSinglePane(
|
|||||||
WatchLifecycleAndUpdateModel(knownFeedContentState)
|
WatchLifecycleAndUpdateModel(knownFeedContentState)
|
||||||
WatchLifecycleAndUpdateModel(newFeedContentState)
|
WatchLifecycleAndUpdateModel(newFeedContentState)
|
||||||
|
|
||||||
ChatroomListFilterAssemblerSubscription(accountViewModel.dataSources().chatroomList, accountViewModel)
|
ChatroomListFilterAssemblerSubscription(accountViewModel)
|
||||||
|
|
||||||
val tabs by
|
val tabs by
|
||||||
remember(knownFeedContentState, markKnownAsRead) {
|
remember(knownFeedContentState, markKnownAsRead) {
|
||||||
|
|||||||
+1
-1
@@ -54,7 +54,7 @@ fun ChatroomList(
|
|||||||
WatchLifecycleAndUpdateModel(knownFeedContentState)
|
WatchLifecycleAndUpdateModel(knownFeedContentState)
|
||||||
WatchLifecycleAndUpdateModel(newFeedContentState)
|
WatchLifecycleAndUpdateModel(newFeedContentState)
|
||||||
|
|
||||||
ChatroomListFilterAssemblerSubscription(accountViewModel.dataSources().chatroomList, accountViewModel)
|
ChatroomListFilterAssemblerSubscription(accountViewModel)
|
||||||
|
|
||||||
val tabs by
|
val tabs by
|
||||||
remember(knownFeedContentState, markKnownAsRead) {
|
remember(knownFeedContentState, markKnownAsRead) {
|
||||||
|
|||||||
+8
@@ -26,6 +26,14 @@ import androidx.lifecycle.viewModelScope
|
|||||||
import com.vitorpamplona.amethyst.service.relayClient.KeyDataSourceSubscription
|
import com.vitorpamplona.amethyst.service.relayClient.KeyDataSourceSubscription
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun DiscoveryFilterAssemblerSubscription(accountViewModel: AccountViewModel) {
|
||||||
|
DiscoveryFilterAssemblerSubscription(
|
||||||
|
accountViewModel.dataSources().discovery,
|
||||||
|
accountViewModel,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun DiscoveryFilterAssemblerSubscription(
|
fun DiscoveryFilterAssemblerSubscription(
|
||||||
dataSource: DiscoveryFilterAssembler,
|
dataSource: DiscoveryFilterAssembler,
|
||||||
|
|||||||
+2
-1
@@ -96,7 +96,8 @@ fun HomeScreen(
|
|||||||
|
|
||||||
WatchLifecycleAndUpdateModel(newThreadsFeedState)
|
WatchLifecycleAndUpdateModel(newThreadsFeedState)
|
||||||
WatchLifecycleAndUpdateModel(repliesFeedState)
|
WatchLifecycleAndUpdateModel(repliesFeedState)
|
||||||
HomeFilterAssemblerSubscription(accountViewModel.dataSources().home, accountViewModel)
|
|
||||||
|
HomeFilterAssemblerSubscription(accountViewModel)
|
||||||
|
|
||||||
AssembleHomeTabs(newThreadsFeedState, repliesFeedState) { pagerState, tabItems ->
|
AssembleHomeTabs(newThreadsFeedState, repliesFeedState) { pagerState, tabItems ->
|
||||||
HomePages(pagerState, tabItems, accountViewModel, nav)
|
HomePages(pagerState, tabItems, accountViewModel, nav)
|
||||||
|
|||||||
+8
@@ -26,6 +26,14 @@ import androidx.lifecycle.viewModelScope
|
|||||||
import com.vitorpamplona.amethyst.service.relayClient.KeyDataSourceSubscription
|
import com.vitorpamplona.amethyst.service.relayClient.KeyDataSourceSubscription
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun HomeFilterAssemblerSubscription(accountViewModel: AccountViewModel) {
|
||||||
|
HomeFilterAssemblerSubscription(
|
||||||
|
accountViewModel.dataSources().home,
|
||||||
|
accountViewModel,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun HomeFilterAssemblerSubscription(
|
fun HomeFilterAssemblerSubscription(
|
||||||
dataSource: HomeFilterAssembler,
|
dataSource: HomeFilterAssembler,
|
||||||
|
|||||||
+1
-1
@@ -124,7 +124,7 @@ fun VideoScreen(
|
|||||||
) {
|
) {
|
||||||
WatchLifecycleAndUpdateModel(videoFeedContentState)
|
WatchLifecycleAndUpdateModel(videoFeedContentState)
|
||||||
WatchAccountForVideoScreen(videoFeedContentState = videoFeedContentState, accountViewModel = accountViewModel)
|
WatchAccountForVideoScreen(videoFeedContentState = videoFeedContentState, accountViewModel = accountViewModel)
|
||||||
VideoFilterAssemblerSubscription(accountViewModel.dataSources().video, accountViewModel)
|
VideoFilterAssemblerSubscription(accountViewModel)
|
||||||
|
|
||||||
DisappearingScaffold(
|
DisappearingScaffold(
|
||||||
isInvertedLayout = false,
|
isInvertedLayout = false,
|
||||||
|
|||||||
+8
@@ -26,6 +26,14 @@ import androidx.lifecycle.viewModelScope
|
|||||||
import com.vitorpamplona.amethyst.service.relayClient.KeyDataSourceSubscription
|
import com.vitorpamplona.amethyst.service.relayClient.KeyDataSourceSubscription
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun VideoFilterAssemblerSubscription(accountViewModel: AccountViewModel) {
|
||||||
|
VideoFilterAssemblerSubscription(
|
||||||
|
accountViewModel.dataSources().video,
|
||||||
|
accountViewModel,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun VideoFilterAssemblerSubscription(
|
fun VideoFilterAssemblerSubscription(
|
||||||
filterAssembler: VideoFilterAssembler,
|
filterAssembler: VideoFilterAssembler,
|
||||||
|
|||||||
Reference in New Issue
Block a user