diff options
| author | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2023-11-17 11:20:12 +0100 |
|---|---|---|
| committer | Albin <albin@mullvad.net> | 2023-11-17 15:01:50 +0100 |
| commit | 427e5ec293d7ced0306d851b988f859b25eba454 (patch) | |
| tree | 33cd64c59facebc1d4960d297a56d8be63db69c6 | |
| parent | e45003f1197b7c34c9c3b99f36d52319140af4fb (diff) | |
| download | mullvadvpn-427e5ec293d7ced0306d851b988f859b25eba454.tar.xz mullvadvpn-427e5ec293d7ced0306d851b988f859b25eba454.zip | |
Fix missing capitalization in device removal dialog
3 files changed, 14 insertions, 7 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceRemovalDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceRemovalDialog.kt index e08a82d694..d99f9e62b7 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceRemovalDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceRemovalDialog.kt @@ -28,7 +28,7 @@ import net.mullvad.mullvadvpn.model.Device @Preview @Composable private fun PreviewShowDeviceRemovalDialog() { - ShowDeviceRemovalDialog( + DeviceRemovalDialog( onDismiss = {}, onConfirm = {}, device = Device("test", "test", byteArrayOf(), "test") @@ -36,7 +36,7 @@ private fun PreviewShowDeviceRemovalDialog() { } @Composable -fun ShowDeviceRemovalDialog(onDismiss: () -> Unit, onConfirm: () -> Unit, device: Device) { +fun DeviceRemovalDialog(onDismiss: () -> Unit, onConfirm: () -> Unit, device: Device) { AlertDialog( onDismissRequest = onDismiss, title = { @@ -53,7 +53,10 @@ fun ShowDeviceRemovalDialog(onDismiss: () -> Unit, onConfirm: () -> Unit, device }, text = { val htmlFormattedDialogText = - textResource(id = R.string.max_devices_confirm_removal_description, device.name) + textResource( + id = R.string.max_devices_confirm_removal_description, + device.displayName() + ) HtmlText(htmlFormattedString = htmlFormattedDialogText, textSize = 16.sp.value) }, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt index f5764f069e..7064d82b9e 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt @@ -26,7 +26,7 @@ import net.mullvad.mullvadvpn.compose.button.PrimaryButton import net.mullvad.mullvadvpn.compose.button.VariantButton import net.mullvad.mullvadvpn.compose.component.ListItem import net.mullvad.mullvadvpn.compose.component.ScaffoldWithTopBar -import net.mullvad.mullvadvpn.compose.dialog.ShowDeviceRemovalDialog +import net.mullvad.mullvadvpn.compose.dialog.DeviceRemovalDialog import net.mullvad.mullvadvpn.compose.state.DeviceListItemUiState import net.mullvad.mullvadvpn.compose.state.DeviceListUiState import net.mullvad.mullvadvpn.lib.common.util.parseAsDateTime @@ -74,7 +74,7 @@ fun DeviceListScreen( onConfirmDeviceRemovalDialog: () -> Unit = {} ) { if (state.stagedDevice != null) { - ShowDeviceRemovalDialog( + DeviceRemovalDialog( onDismiss = onDismissDeviceRemovalDialog, onConfirmDeviceRemovalDialog, device = state.stagedDevice diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/Device.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/Device.kt index 25c729eb87..0f0a55d05d 100644 --- a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/Device.kt +++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/Device.kt @@ -4,8 +4,12 @@ import android.os.Parcelable import kotlinx.parcelize.Parcelize @Parcelize -data class Device(val id: String, val name: String, val pubkey: ByteArray, val created: String) : - Parcelable { +data class Device( + val id: String, + private val name: String, + val pubkey: ByteArray, + val created: String +) : Parcelable { // Generated by Android Studio override fun equals(other: Any?): Boolean { if (this === other) return true |
