Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Fix showing other cipher data when cipher doesn't have username and p…
Browse files Browse the repository at this point in the history
…assword
  • Loading branch information
M3DZIK committed Feb 28, 2024
1 parent d39a8dc commit 7988403
Showing 1 changed file with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}
}

Expand Down

0 comments on commit 7988403

Please sign in to comment.