Watches the okHttp client for web calls (only active when screen is visible)

This commit is contained in:
Vitor Pamplona
2025-10-20 19:40:04 -04:00
parent 48a69f1d26
commit 63bd0b6cae

View File

@@ -44,6 +44,7 @@ import com.vitorpamplona.quartz.utils.Log
fun AccountScreen(accountStateViewModel: AccountStateViewModel) { fun AccountScreen(accountStateViewModel: AccountStateViewModel) {
// Pauses relay services when the app pauses // Pauses relay services when the app pauses
ManageRelayServices() ManageRelayServices()
ManageWebOkHttp()
val accountState by accountStateViewModel.accountContent.collectAsStateWithLifecycle() val accountState by accountStateViewModel.accountContent.collectAsStateWithLifecycle()
@@ -67,6 +68,14 @@ fun ManageRelayServices() {
.collectAsStateWithLifecycle() .collectAsStateWithLifecycle()
} }
@Composable
fun ManageWebOkHttp() {
val torWebServices by Amethyst.instance.okHttpClients.defaultHttpClient
.collectAsStateWithLifecycle()
val openWebServices by Amethyst.instance.okHttpClients.defaultHttpClientWithoutProxy
.collectAsStateWithLifecycle()
}
@Composable @Composable
fun LoadingSetup() { fun LoadingSetup() {
// A surface container using the 'background' color from the theme // A surface container using the 'background' color from the theme