Do not show extended proxy details in App Settings if proxy type is system or none (#661)

Fixes: #660
This commit is contained in:
Michael Biebl 2024-03-21 11:44:03 +01:00 committed by GitHub
parent 5921fb2bb6
commit 014c94a031
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -284,6 +284,7 @@ class AppSettingsActivity: AppCompatActivity() {
onDismiss = { showProxyTypeInputDialog = false }
)
if (proxyType !in listOf(Settings.PROXY_TYPE_SYSTEM, Settings.PROXY_TYPE_NONE)) {
var showProxyHostNameInputDialog by remember { mutableStateOf(false) }
Setting(
name = stringResource(R.string.app_settings_proxy_host),
@ -317,13 +318,14 @@ class AppSettingsActivity: AppCompatActivity() {
val newPort = it.toInt()
if (newPort in 1..65535)
onProxyPortUpdated(newPort)
} catch(_: NumberFormatException) {
} catch (_: NumberFormatException) {
// user entered invalid port number
}
},
onDismiss = { showProxyPortInputDialog = false }
)
}
}
@Composable
@Preview