diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModel.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModel.kt index 56c166148..d01373ac9 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModel.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModel.kt @@ -834,8 +834,8 @@ data class VaultState( * Represents an identity item within the vault, containing personal identification * information. * - * @property firstName The first name of the individual associated with this - * identity item. + * @property fullName The first and last name of the individual associated with + * this identity item. */ @Parcelize data class Identity( @@ -845,9 +845,9 @@ data class VaultState( override val extraIconList: List = emptyList(), override val overflowOptions: List, override val shouldShowMasterPasswordReprompt: Boolean, - val firstName: Text?, + val fullName: Text?, ) : VaultItem() { - override val supportingLabel: Text? get() = firstName + override val supportingLabel: Text? get() = fullName } /** diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultDataExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultDataExtensions.kt index a162e8bd6..1824b420c 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultDataExtensions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultDataExtensions.kt @@ -10,6 +10,7 @@ import com.bitwarden.core.LoginUriView import com.x8bit.bitwarden.R import com.x8bit.bitwarden.data.vault.repository.model.VaultData import com.x8bit.bitwarden.ui.platform.base.util.asText +import com.x8bit.bitwarden.ui.platform.base.util.orNullIfBlank import com.x8bit.bitwarden.ui.platform.components.model.IconData import com.x8bit.bitwarden.ui.vault.feature.util.toLabelIcons import com.x8bit.bitwarden.ui.vault.feature.util.toOverflowActions @@ -211,7 +212,12 @@ private fun CipherView.toVaultItemOrNull( CipherType.IDENTITY -> VaultState.ViewState.VaultItem.Identity( id = id, name = name.asText(), - firstName = identity?.firstName?.asText(), + fullName = when { + identity?.firstName.isNullOrBlank() -> identity?.lastName?.orNullIfBlank() + identity?.lastName.isNullOrBlank() -> identity?.firstName + else -> "${identity?.firstName} ${identity?.lastName}" + } + ?.asText(), overflowOptions = toOverflowActions(), extraIconList = toLabelIcons(), shouldShowMasterPasswordReprompt = reprompt == CipherRepromptType.PASSWORD,