Skip to content

Commit

Permalink
fix: disable pin lock
Browse files Browse the repository at this point in the history
  • Loading branch information
zaneschepke committed Jun 1, 2024
1 parent 571fb1b commit 8bbe81d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8bbe81d

Please sign in to comment.