mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-11 00:43:40 +02:00
Merge pull request #1040 from davotoula/1037-tor-setting-reset-to-off-after-switching-away
1037 tor setting reset to off after switching away
This commit is contained in:
@@ -252,7 +252,7 @@ class AccountSettings(
|
|||||||
portNumber: String,
|
portNumber: String,
|
||||||
) {
|
) {
|
||||||
val port = portNumber.toIntOrNull() ?: return
|
val port = portNumber.toIntOrNull() ?: return
|
||||||
if (proxyPort != port && isProxyEnabled() != enabled) {
|
if (proxyPort != port || isProxyEnabled() != enabled) {
|
||||||
proxyPort = portNumber.toInt()
|
proxyPort = portNumber.toInt()
|
||||||
proxy = HttpClientManager.initProxy(enabled, "127.0.0.1", proxyPort)
|
proxy = HttpClientManager.initProxy(enabled, "127.0.0.1", proxyPort)
|
||||||
saveAccountSettings()
|
saveAccountSettings()
|
||||||
|
@@ -472,43 +472,42 @@ fun LoginPage(
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
Spacer(modifier = Modifier.height(10.dp))
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(10.dp))
|
if (PackageUtils.isOrbotInstalled(context)) {
|
||||||
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
|
Checkbox(
|
||||||
|
checked = useProxy.value,
|
||||||
|
onCheckedChange = {
|
||||||
|
if (it) {
|
||||||
|
connectOrbotDialogOpen = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
if (PackageUtils.isOrbotInstalled(context)) {
|
Text(stringRes(R.string.connect_via_tor))
|
||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
}
|
||||||
Checkbox(
|
|
||||||
checked = useProxy.value,
|
|
||||||
onCheckedChange = {
|
|
||||||
if (it) {
|
|
||||||
connectOrbotDialogOpen = true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
Text(stringRes(R.string.connect_via_tor))
|
if (connectOrbotDialogOpen) {
|
||||||
}
|
ConnectOrbotDialog(
|
||||||
|
onClose = { connectOrbotDialogOpen = false },
|
||||||
if (connectOrbotDialogOpen) {
|
onPost = {
|
||||||
ConnectOrbotDialog(
|
connectOrbotDialogOpen = false
|
||||||
onClose = { connectOrbotDialogOpen = false },
|
useProxy.value = true
|
||||||
onPost = {
|
},
|
||||||
connectOrbotDialogOpen = false
|
onError = {
|
||||||
useProxy.value = true
|
scope.launch {
|
||||||
},
|
Toast
|
||||||
onError = {
|
.makeText(
|
||||||
scope.launch {
|
context,
|
||||||
Toast
|
it,
|
||||||
.makeText(
|
Toast.LENGTH_LONG,
|
||||||
context,
|
).show()
|
||||||
it,
|
}
|
||||||
Toast.LENGTH_LONG,
|
},
|
||||||
).show()
|
proxyPort,
|
||||||
}
|
)
|
||||||
},
|
|
||||||
proxyPort,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user