fix: disable pin lock
This commit is contained in:
parent
571fb1b12c
commit
8bbe81d294
|
@ -49,7 +49,8 @@ class WireGuardAutoTunnel : Application() {
|
|||
)
|
||||
} else Timber.plant(ReleaseTree())
|
||||
applicationScope.launch(ioDispatcher) {
|
||||
PinManager.initialize(this@WireGuardAutoTunnel)
|
||||
//TODO disable pin lock for now
|
||||
//PinManager.initialize(this@WireGuardAutoTunnel)
|
||||
if (!isRunningOnAndroidTv()) localLogCollector.start()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -202,7 +202,9 @@ class MainActivity : AppCompatActivity() {
|
|||
NavHost(
|
||||
navController,
|
||||
startDestination =
|
||||
(if (PinManager.pinExists()) Screen.Lock.route else Screen.Main.route),
|
||||
//TODO disable pin lock
|
||||
//(if (PinManager.pinExists()) Screen.Lock.route else Screen.Main.route),
|
||||
Screen.Main.route,
|
||||
modifier =
|
||||
Modifier
|
||||
.padding(padding)
|
||||
|
|
|
@ -103,7 +103,7 @@ fun SettingsScreen(
|
|||
val scope = rememberCoroutineScope()
|
||||
val scrollState = rememberScrollState()
|
||||
val interactionSource = remember { MutableInteractionSource() }
|
||||
val pinExists = remember { mutableStateOf(PinManager.pinExists()) }
|
||||
//val pinExists = remember { mutableStateOf(PinManager.pinExists()) }
|
||||
|
||||
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
|
||||
val kernelSupport by viewModel.kernelSupport.collectAsStateWithLifecycle()
|
||||
|
@ -652,20 +652,21 @@ fun SettingsScreen(
|
|||
onCheckChanged = { viewModel.onToggleShortcutsEnabled() },
|
||||
)
|
||||
}
|
||||
ConfigurationToggle(
|
||||
stringResource(R.string.enable_app_lock),
|
||||
enabled = true,
|
||||
checked = pinExists.value,
|
||||
padding = screenPadding,
|
||||
onCheckChanged = {
|
||||
if (pinExists.value) {
|
||||
PinManager.clearPin()
|
||||
pinExists.value = PinManager.pinExists()
|
||||
} else {
|
||||
navController.navigate(Screen.Lock.route)
|
||||
}
|
||||
},
|
||||
)
|
||||
// TODO disable for now
|
||||
// ConfigurationToggle(
|
||||
// stringResource(R.string.enable_app_lock),
|
||||
// enabled = true,
|
||||
// checked = pinExists.value,
|
||||
// padding = screenPadding,
|
||||
// onCheckChanged = {
|
||||
// if (pinExists.value) {
|
||||
// PinManager.clearPin()
|
||||
// pinExists.value = PinManager.pinExists()
|
||||
// } else {
|
||||
// navController.navigate(Screen.Lock.route)
|
||||
// }
|
||||
// },
|
||||
// )
|
||||
if (!WireGuardAutoTunnel.isRunningOnAndroidTv()) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
|
|
Loading…
Reference in New Issue