From 63bd0b6caecc3ed794f79ec394afd718b24fd0e3 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 20 Oct 2025 19:40:04 -0400 Subject: [PATCH] Watches the okHttp client for web calls (only active when screen is visible) --- .../vitorpamplona/amethyst/ui/screen/AccountScreen.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/AccountScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/AccountScreen.kt index 2e725c53e6..f90f8fbd7a 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/AccountScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/AccountScreen.kt @@ -44,6 +44,7 @@ import com.vitorpamplona.quartz.utils.Log fun AccountScreen(accountStateViewModel: AccountStateViewModel) { // Pauses relay services when the app pauses ManageRelayServices() + ManageWebOkHttp() val accountState by accountStateViewModel.accountContent.collectAsStateWithLifecycle() @@ -67,6 +68,14 @@ fun ManageRelayServices() { .collectAsStateWithLifecycle() } +@Composable +fun ManageWebOkHttp() { + val torWebServices by Amethyst.instance.okHttpClients.defaultHttpClient + .collectAsStateWithLifecycle() + val openWebServices by Amethyst.instance.okHttpClients.defaultHttpClientWithoutProxy + .collectAsStateWithLifecycle() +} + @Composable fun LoadingSetup() { // A surface container using the 'background' color from the theme