Display specific message when verif code malformed
This commit is contained in:
parent
69920a6e46
commit
86b888c336
|
@ -84,7 +84,7 @@ internal class DefaultQrCodeVerificationTransaction(
|
|||
// Perform some checks
|
||||
if (otherQrCodeData.transactionId != transactionId) {
|
||||
Timber.d("## Verification QR: Invalid transaction actual ${otherQrCodeData.transactionId} expected:$transactionId")
|
||||
cancel(CancelCode.QrCodeInvalid)
|
||||
cancel(CancelCode.UnknownTransaction)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -86,6 +86,14 @@ class VerificationConclusionController @Inject constructor(
|
|||
|
||||
bottomGotIt()
|
||||
}
|
||||
ConclusionState.INVALID_QR_CODE -> {
|
||||
bottomSheetVerificationNoticeItem {
|
||||
id("invalid_qr")
|
||||
notice(host.stringProvider.getString(R.string.verify_invalid_qr_notice).toEpoxyCharSequence())
|
||||
}
|
||||
|
||||
bottomGotIt()
|
||||
}
|
||||
ConclusionState.CANCELLED -> {
|
||||
bottomSheetVerificationNoticeItem {
|
||||
id("notice_cancelled")
|
||||
|
|
|
@ -32,7 +32,8 @@ data class VerificationConclusionViewState(
|
|||
enum class ConclusionState {
|
||||
SUCCESS,
|
||||
WARNING,
|
||||
CANCELLED
|
||||
CANCELLED,
|
||||
INVALID_QR_CODE
|
||||
}
|
||||
|
||||
class VerificationConclusionViewModel(initialState: VerificationConclusionViewState) :
|
||||
|
@ -44,7 +45,9 @@ class VerificationConclusionViewModel(initialState: VerificationConclusionViewSt
|
|||
val args = viewModelContext.args<VerificationConclusionFragment.Args>()
|
||||
|
||||
return when (safeValueOf(args.cancelReason)) {
|
||||
CancelCode.QrCodeInvalid,
|
||||
CancelCode.QrCodeInvalid -> {
|
||||
VerificationConclusionViewState(ConclusionState.INVALID_QR_CODE, args.isMe)
|
||||
}
|
||||
CancelCode.MismatchedUser,
|
||||
CancelCode.MismatchedSas,
|
||||
CancelCode.MismatchedCommitment,
|
||||
|
|
|
@ -2361,6 +2361,7 @@
|
|||
</string>
|
||||
|
||||
<string name="verify_cancelled_notice">Verification has been cancelled. You can start verification again.</string>
|
||||
<string name="verify_invalid_qr_notice">This QR code looks malformed. Please try to verify with another method.</string>
|
||||
<string name="verification_cancelled">Verification Cancelled</string>
|
||||
|
||||
<string name="recovery_passphrase">Recovery Passphrase</string>
|
||||
|
|
Loading…
Reference in New Issue