Skip to content

Commit

Permalink
Merge pull request #1210 from radixdlt/bugfix/accounts-personas-seed-…
Browse files Browse the repository at this point in the history
…phrase-missing

Accounts personas seed phrase missing dialog
  • Loading branch information
micbakos-rdx committed Sep 30, 2024
2 parents af41fe1 + c945c39 commit e435c82
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class BuildAuthorizedDappResponseUseCase @Inject constructor(
)
)
}.onFailure {
response = Result.failure(it)
response = Result.failure(RadixWalletException.DappRequestException.FailedToSignAuthChallenge(it))
}
response
}
Expand Down Expand Up @@ -305,7 +305,7 @@ class BuildUnauthorizedDappResponseUseCase @Inject constructor(
).onSuccess { result ->
entitiesWithSignatures = result.signersWithSignatures
}.onFailure { error ->
return Result.failure(error)
return Result.failure(RadixWalletException.DappRequestException.FailedToSignAuthChallenge(error))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ class DAppAuthorizedLoginViewModel @Inject constructor(
_state.update { it.copy(isNoMnemonicErrorVisible = true) }
}

is RadixWalletException.LedgerCommunicationException, is RadixWalletException.SignatureCancelled -> {}
is RadixWalletException.LedgerCommunicationException,
is RadixWalletException.SignatureCancelled,
is RadixWalletException.DappRequestException.RejectedByUser -> {}

else -> {
respondToIncomingRequestUseCase.respondWithFailure(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ class DAppUnauthorizedLoginViewModel @Inject constructor(
}

private suspend fun handleRequestError(exception: Throwable) {
if (exception is RadixWalletException.DappRequestException.RejectedByUser) {
return // user rejected/cancelled signing, do not close the request screen
}
if (exception is RadixWalletException.DappRequestException) {
logNonFatalException(exception)
when (exception.cause) {
Expand All @@ -150,7 +147,9 @@ class DAppUnauthorizedLoginViewModel @Inject constructor(
_state.update { it.copy(isNoMnemonicErrorVisible = true) }
}

is RadixWalletException.LedgerCommunicationException, is RadixWalletException.SignatureCancelled -> {}
is RadixWalletException.LedgerCommunicationException,
is RadixWalletException.SignatureCancelled,
is RadixWalletException.DappRequestException.RejectedByUser -> {}

else -> {
respondToIncomingRequestUseCase.respondWithFailure(
Expand All @@ -161,10 +160,6 @@ class DAppUnauthorizedLoginViewModel @Inject constructor(
_state.update { it.copy(failureDialogState = FailureDialogState.Open(exception)) }
}
}
} else {
if (exception is ProfileException.NoMnemonic) {
_state.update { it.copy(isNoMnemonicErrorVisible = true) }
}
}
}

Expand Down

0 comments on commit e435c82

Please sign in to comment.