Add switch toggle to Per-App Proxy setting
This commit is contained in:
@@ -51,6 +51,7 @@ fun ProfileOverrideScreen(navController: NavController) {
|
||||
val scope = rememberCoroutineScope()
|
||||
|
||||
var autoRedirect by remember { mutableStateOf(Settings.autoRedirect) }
|
||||
var perAppProxyEnabled by remember { mutableStateOf(Settings.perAppProxyEnabled) }
|
||||
var showPerAppProxyDialog by remember { mutableStateOf(false) }
|
||||
|
||||
Column(
|
||||
@@ -172,6 +173,19 @@ fun ProfileOverrideScreen(navController: NavController) {
|
||||
tint = MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
},
|
||||
trailingContent = {
|
||||
if (isPerAppProxyAvailable) {
|
||||
Switch(
|
||||
checked = perAppProxyEnabled,
|
||||
onCheckedChange = { checked ->
|
||||
perAppProxyEnabled = checked
|
||||
scope.launch(Dispatchers.IO) {
|
||||
Settings.perAppProxyEnabled = checked
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
},
|
||||
modifier =
|
||||
Modifier
|
||||
.clip(RoundedCornerShape(bottomStart = 12.dp, bottomEnd = 12.dp))
|
||||
|
||||
Reference in New Issue
Block a user