Fix Preimage failure of Null amount for Tangle (#10833)
* Fix possible Null value * Fix the problem in Preimage instead of FormatBalance * remove console
This commit is contained in:
parent
053b8d1723
commit
2053ad1e59
@ -8,6 +8,7 @@ import React from 'react';
|
||||
import { AddressMini, MarkError, MarkWarning } from '@polkadot/react-components';
|
||||
import { ZERO_ACCOUNT } from '@polkadot/react-hooks/useWeight';
|
||||
import { CallExpander } from '@polkadot/react-params';
|
||||
import { Null } from '@polkadot/types-codec';
|
||||
|
||||
import { useTranslation } from '../translate.js';
|
||||
|
||||
@ -48,7 +49,9 @@ function PreimageCall ({ className = '', value }: Props): React.ReactElement<Pro
|
||||
? value.deposit
|
||||
? (
|
||||
<AddressMini
|
||||
balance={value.deposit.amount}
|
||||
// HACK: In the rare case that the value is passed down as a Null Codec type as seen with Tangle
|
||||
// We ensure to handle that case. ref: https://github.com/polkadot-js/apps/issues/10793
|
||||
balance={!(value.deposit.amount instanceof Null) ? value.deposit.amount : undefined}
|
||||
value={value.deposit.who}
|
||||
withBalance
|
||||
/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user