summaryrefslogtreecommitdiffhomepage
path: root/android/app
diff options
context:
space:
mode:
authorJonatan Rhodin <jonatan.rhodin@mullvad.net>2023-08-24 10:23:07 +0200
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2023-08-24 10:23:07 +0200
commita22ee7fc19a0e4e90c4347be2376e79f379ecc1a (patch)
tree98a0ba77ea3b263c6bb72c94e74c3ea450eb933e /android/app
parent37c51c733d26e25ef9720fa7b2ce607a116ba353 (diff)
downloadmullvadvpn-a22ee7fc19a0e4e90c4347be2376e79f379ecc1a.tar.xz
mullvadvpn-a22ee7fc19a0e4e90c4347be2376e79f379ecc1a.zip
Check that the custom port is valid when submitting from the keyboard
Diffstat (limited to 'android/app')
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt
index ce8b525c4d..c2298783d8 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt
@@ -106,10 +106,11 @@ fun CustomPortDialog(
CustomPortTextField(
value = port.value,
onSubmit = { input ->
- if (input.isNotEmpty()) {
+ if (
+ input.isNotEmpty() &&
+ allowedPortRanges.isPortInValidRanges(input.toInt())
+ ) {
onSave(input)
- } else {
- onReset()
}
},
onValueChanged = { input -> port.value = input },