Skip to content

Commit cd6d46a

Browse files
kaja-osojniklukaw3d
authored andcommitted
Fix Sapphire undelegate transactions: display number of shares
1 parent b383cb5 commit cd6d46a

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

.changelog/1892.bugfix.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix Sapphire undelegate transactions: display number of shares

src/app/components/Transactions/RuntimeTransactions.tsx

+10-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,16 @@ export const RuntimeTransactions: FC<TransactionsProps> = ({
157157
},
158158
{
159159
align: TableCellAlign.Right,
160-
content: <RoundedBalance value={transaction.amount} ticker={transaction.amount_symbol} />,
160+
content:
161+
transaction.amount && transaction.amount !== '0' ? (
162+
<RoundedBalance value={transaction.amount} ticker={transaction.amount_symbol} />
163+
) : (
164+
<RoundedBalance
165+
compactLargeNumbers
166+
value={transaction?.body?.shares}
167+
ticker={t('common.shares')}
168+
/>
169+
),
161170
key: 'value',
162171
},
163172
{

src/app/pages/RuntimeTransactionDetailPage/index.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { MultipleTransactionsWarning } from '../../components/Transactions/Multi
3333
import { JsonCodeDisplay } from '../..//components/CodeDisplay'
3434
import { isRoflTransaction } from '../../utils/transaction'
3535
import Box from '@mui/material/Box'
36+
import { RoundedBalance } from 'app/components/RoundedBalance'
3637

3738
export const RuntimeTransactionDetailPage: FC = () => {
3839
const { t } = useTranslation()
@@ -210,6 +211,19 @@ export const RuntimeTransactionDetailView: FC<{
210211
: t('common.missing')}
211212
</dd>
212213

214+
{transaction?.body?.shares && (
215+
<>
216+
<dt>{t('common.shares')}</dt>
217+
<dd>
218+
<RoundedBalance
219+
compactLargeNumbers
220+
value={transaction?.body?.shares}
221+
ticker={t('common.shares')}
222+
/>
223+
</dd>
224+
</>
225+
)}
226+
213227
{showFiatValues &&
214228
transaction.amount !== undefined &&
215229
!!amountSymbolPriceInfo &&

0 commit comments

Comments
 (0)