Skip to content

Commit

Permalink
fix: preshared key password field
Browse files Browse the repository at this point in the history
  • Loading branch information
zaneschepke authored and Andr3Carvalh0 committed Dec 8, 2024
1 parent 27d6831 commit 0db67a8
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,27 @@ fun ConfigScreen(tunnelId: Int) {
hint = stringResource(R.string.base64_key),
modifier = Modifier.fillMaxWidth(),
)
ConfigurationTextBox(
OutlinedTextField(
modifier =
Modifier
.fillMaxWidth()
.clickable { showAuthPrompt = true },
value = peer.preSharedKey,
visualTransformation =
if ((tunnelId == Constants.MANUAL_TUNNEL_CONFIG_ID.toInt()) || isAuthenticated) {
VisualTransformation.None
} else {
PasswordVisualTransformation()
},
enabled = (tunnelId == Constants.MANUAL_TUNNEL_CONFIG_ID.toInt()) || isAuthenticated || peer.preSharedKey.isEmpty(),
onValueChange = { value ->
viewModel.onPreSharedKeyChange(index, value)
},
label = { Text(stringResource(R.string.preshared_key)) },
singleLine = true,
placeholder = { Text(stringResource(R.string.optional)) },
keyboardOptions = keyboardOptions,
keyboardActions = keyboardActions,
label = stringResource(R.string.preshared_key),
hint = stringResource(R.string.optional),
modifier = Modifier.fillMaxWidth(),
)
OutlinedTextField(
modifier = Modifier.fillMaxWidth(),
Expand Down

0 comments on commit 0db67a8

Please sign in to comment.