feat: add BluetoothConfig.fixedPin validation

This commit is contained in:
andrekir 2023-01-10 17:32:50 -03:00
parent eaaadf3b34
commit 22e83ba953

View file

@ -792,7 +792,10 @@ fun DeviceSettingsItemList(viewModel: UIViewModel) {
value = bluetoothInput.fixedPin,
enabled = connected,
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
onValueChanged = { bluetoothInput = bluetoothInput.copy { fixedPin = it } })
onValueChanged = {
if (it.toString().length == 6) // ensure 6 digits
bluetoothInput = bluetoothInput.copy { fixedPin = it }
})
}
item {