From 2f58849ed988efb893194e1c05b811b101378f6f Mon Sep 17 00:00:00 2001 From: lukaw3d Date: Thu, 5 Sep 2024 21:46:25 +0200 Subject: [PATCH] Fix displaying negative allowance changes --- .changelog/1529.bugfix.md | 1 + src/app/utils/transaction.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changelog/1529.bugfix.md diff --git a/.changelog/1529.bugfix.md b/.changelog/1529.bugfix.md new file mode 100644 index 000000000..967d4d32c --- /dev/null +++ b/.changelog/1529.bugfix.md @@ -0,0 +1 @@ +Fix displaying negative allowance changes diff --git a/src/app/utils/transaction.ts b/src/app/utils/transaction.ts index 3836c3e7b..9d66f547e 100644 --- a/src/app/utils/transaction.ts +++ b/src/app/utils/transaction.ts @@ -18,7 +18,9 @@ export const getConsensusTransactionToAddress = (transaction: Transaction) => { export const getConsensusTransactionAmount = (transaction: Transaction) => { switch (transaction.method) { case ConsensusTxMethod.stakingAllow: - return transaction.body?.amount_change + return transaction.body?.negative + ? `-${transaction.body?.amount_change}` + : transaction.body?.amount_change case ConsensusTxMethod.stakingAddEscrow: case ConsensusTxMethod.stakingTransfer: return transaction.body?.amount