Skip to content

Commit

Permalink
fix: show error message when decode tx fails (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroferreira1 authored Oct 3, 2024
1 parent 3bd5f95 commit 096441d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/screens/DecodeTx.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ function DecodeTx() {
const buttonClicked = async () => {
try {
const data = await txApi.decodeTx(dataToDecode);
setSuccess(data.success);
if (!data.success) {
setTransaction(null);
setConfirmationData(null);
setMeta(null);
setSpentOutputs(null);
setSuccess(false);
return;
}
setSuccess(true);
setTransaction(data.tx);
setMeta(data.meta);
setSpentOutputs(data.spent_outputs);
Expand Down

0 comments on commit 096441d

Please sign in to comment.