mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Fix default name for linked devices.
This commit is contained in:
@@ -3,4 +3,4 @@ package org.thoughtcrime.securesms.linkdevice
|
||||
/**
|
||||
* Class that represents a linked device
|
||||
*/
|
||||
data class Device(val id: Long, val name: String, val createdMillis: Long, val lastSeenMillis: Long)
|
||||
data class Device(val id: Long, val name: String?, val createdMillis: Long, val lastSeenMillis: Long)
|
||||
|
||||
@@ -200,8 +200,9 @@ fun DeviceDescriptionScreen(
|
||||
}
|
||||
if (state.deviceToRemove != null) {
|
||||
val device: Device = state.deviceToRemove
|
||||
val name = if (device.name.isNullOrEmpty()) stringResource(R.string.DeviceListItem_unnamed_device) else device.name
|
||||
Dialogs.SimpleAlertDialog(
|
||||
title = stringResource(id = R.string.DeviceListActivity_unlink_s, device.name),
|
||||
title = stringResource(id = R.string.DeviceListActivity_unlink_s, name),
|
||||
body = stringResource(id = R.string.DeviceListActivity_by_unlinking_this_device_it_will_no_longer_be_able_to_send_or_receive),
|
||||
confirm = stringResource(R.string.LinkDeviceFragment__unlink),
|
||||
dismiss = stringResource(android.R.string.cancel),
|
||||
@@ -312,7 +313,7 @@ fun DeviceDescriptionScreen(
|
||||
|
||||
@Composable
|
||||
fun DeviceRow(device: Device, setDeviceToRemove: (Device) -> Unit) {
|
||||
val titleString = device.name.ifEmpty { stringResource(R.string.DeviceListItem_unnamed_device) }
|
||||
val titleString = if (device.name.isNullOrEmpty()) stringResource(R.string.DeviceListItem_unnamed_device) else device.name
|
||||
val linkedDate = DateUtils.getDayPrecisionTimeSpanString(LocalContext.current, Locale.getDefault(), device.createdMillis)
|
||||
val lastActive = DateUtils.getDayPrecisionTimeSpanString(LocalContext.current, Locale.getDefault(), device.lastSeenMillis)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user