From 7988403666ea9c9bb566ac80bbe655397b533d79 Mon Sep 17 00:00:00 2001 From: M3DZIK Date: Wed, 28 Feb 2024 23:36:11 +0100 Subject: [PATCH] Fix showing other cipher data when cipher doesn't have username and password --- .../android/ui/screens/vault/CipherView.kt | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/app/src/main/java/dev/medzik/librepass/android/ui/screens/vault/CipherView.kt b/app/src/main/java/dev/medzik/librepass/android/ui/screens/vault/CipherView.kt index 53f1f91d..5e002f99 100644 --- a/app/src/main/java/dev/medzik/librepass/android/ui/screens/vault/CipherView.kt +++ b/app/src/main/java/dev/medzik/librepass/android/ui/screens/vault/CipherView.kt @@ -190,49 +190,49 @@ fun CipherViewScreen( } } } + } - if (!cipherData.uris.isNullOrEmpty()) { - SecondaryText( - stringResource(R.string.WebsiteDetails), - modifier = Modifier.padding(top = 8.dp) - ) - - cipherData.uris?.forEachIndexed { index, it -> - CipherField( - title = stringResource(R.string.WebsiteAddress) + " ${index + 1}", - value = it, - openUri = true, - uri = it, - copy = true - ) - } - } - - if (!cipherData.notes.isNullOrEmpty()) { - SecondaryText( - stringResource(R.string.OtherDetails), - modifier = Modifier.padding(top = 8.dp) - ) + if (!cipherData.uris.isNullOrEmpty()) { + SecondaryText( + stringResource(R.string.WebsiteDetails), + modifier = Modifier.padding(top = 8.dp) + ) + cipherData.uris?.forEachIndexed { index, it -> CipherField( - title = stringResource(R.string.Notes), - value = cipherData.notes, + title = stringResource(R.string.WebsiteAddress) + " ${index + 1}", + value = it, + openUri = true, + uri = it, copy = true ) } + } - if (!cipherData.twoFactor.isNullOrEmpty()) { - SecondaryText( - stringResource(R.string.TwoFactorAuthentication), - modifier = Modifier.padding(top = 8.dp) - ) + if (!cipherData.notes.isNullOrEmpty()) { + SecondaryText( + stringResource(R.string.OtherDetails), + modifier = Modifier.padding(top = 8.dp) + ) - OtpField( - value = totpCode.chunked(totpDigits / 2).joinToString(" "), - elapsed = totpElapsed, - period = totpPeriod, - ) - } + CipherField( + title = stringResource(R.string.Notes), + value = cipherData.notes, + copy = true + ) + } + + if (!cipherData.twoFactor.isNullOrEmpty()) { + SecondaryText( + stringResource(R.string.TwoFactorAuthentication), + modifier = Modifier.padding(top = 8.dp) + ) + + OtpField( + value = totpCode.chunked(totpDigits / 2).joinToString(" "), + elapsed = totpElapsed, + period = totpPeriod, + ) } }