-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wireguard mtu selection showing again after closing it #5102
Conversation
DROID-303 WireGuard MTU selection pops up twice
Steps to reproduce
Note: The bug does not trigger if the text field is empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
2d8b59c
to
a9b8125
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @Pururun)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt
line 38 at r1 (raw file):
@Composable fun MtuDialog( mtuValueInitial: String,
Can we change this to be Int
or Int?
easily?
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt
line 47 at r1 (raw file):
val smallPadding = 5.dp val mtuValue = remember { mutableStateOf(mtuValueInitial) }
Maybe to avoid writing mtuValue.value
var mtuValue by remember { mutableStateOf(mtuValueInitial) }
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt
line 135 at r1 (raw file):
), text = stringResource(R.string.reset_to_default_button), onClick = { onRestoreDefaultValue() }
Would it be possible to send the function reference directly?
onClick = onRestoreDefaultValue
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt
line 150 at r1 (raw file):
), text = stringResource(R.string.cancel), onClick = { onDismiss() }
Same as a above previous
5b7520e
to
c823ee0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Rawa)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt
line 38 at r1 (raw file):
Previously, Rawa (David Göransson) wrote…
Can we change this to be
Int
orInt?
easily?
Done
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt
line 47 at r1 (raw file):
Previously, Rawa (David Göransson) wrote…
Maybe to avoid writing
mtuValue.value
var mtuValue by remember { mutableStateOf(mtuValueInitial) }
Done
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt
line 135 at r1 (raw file):
Previously, Rawa (David Göransson) wrote…
Would it be possible to send the function reference directly?
onClick = onRestoreDefaultValue
Done
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt
line 150 at r1 (raw file):
Previously, Rawa (David Göransson) wrote…
Same as a above previous
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r2, all commit messages.
Reviewable status: 4 of 5 files reviewed, all discussions resolved (waiting on @sabercodic)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r2.
Reviewable status:complete! all files reviewed, all discussions resolved
c823ee0
to
5fd84a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 5 files at r1.
Reviewable status:complete! all files reviewed, all discussions resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 5 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Pururun)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt
line 120 at r2 (raw file):
isEnabled = isValidMtu, text = stringResource(R.string.submit_button), onClick = { onSave(mtu.value.toIntOrNull() ?: 0) }
Shouldn't this do the same as onSubmit
above? In that case, it would be nice to unify it.
Also, I'm not sure it makes sense to send 0
if we fail to parse.
Code quote:
onClick = { onSave(mtu.value.toIntOrNull() ?: 0) }
5fd84a8
to
0c75ee6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 5 files reviewed, 1 unresolved discussion (waiting on @albin-mullvad and @Rawa)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt
line 120 at r2 (raw file):
Previously, albin-mullvad wrote…
Shouldn't this do the same as
onSubmit
above? In that case, it would be nice to unify it.Also, I'm not sure it makes sense to send
0
if we fail to parse.
Yeah stopped it from saving in both places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
0c75ee6
to
4bdf3a5
Compare
Also made some improvements to the mtu dialog.
This change is