mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 15:27:24 +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) {
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user