Trigger managed mode scan when enabling per-app proxy
This commit is contained in:
@@ -208,15 +208,32 @@ fun ProfileOverrideScreen(navController: NavController) {
|
|||||||
},
|
},
|
||||||
trailingContent = {
|
trailingContent = {
|
||||||
if (isPerAppProxyAvailable) {
|
if (isPerAppProxyAvailable) {
|
||||||
Switch(
|
if (isScanning) {
|
||||||
checked = perAppProxyEnabled,
|
CircularProgressIndicator(
|
||||||
onCheckedChange = { checked ->
|
modifier = Modifier.size(24.dp),
|
||||||
perAppProxyEnabled = checked
|
strokeWidth = 2.dp,
|
||||||
scope.launch(Dispatchers.IO) {
|
)
|
||||||
Settings.perAppProxyEnabled = checked
|
} else {
|
||||||
}
|
Switch(
|
||||||
},
|
checked = perAppProxyEnabled,
|
||||||
)
|
onCheckedChange = { checked ->
|
||||||
|
perAppProxyEnabled = checked
|
||||||
|
scope.launch(Dispatchers.IO) {
|
||||||
|
Settings.perAppProxyEnabled = checked
|
||||||
|
}
|
||||||
|
if (checked && managedModeEnabled) {
|
||||||
|
isScanning = true
|
||||||
|
scope.launch {
|
||||||
|
val chinaApps = scanAllChinaApps()
|
||||||
|
withContext(Dispatchers.IO) {
|
||||||
|
Settings.perAppProxyManagedList = chinaApps
|
||||||
|
}
|
||||||
|
isScanning = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
modifier =
|
modifier =
|
||||||
|
|||||||
Reference in New Issue
Block a user