mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 06:57:34 +01:00
Watches the okHttp client for web calls (only active when screen is visible)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user