Fixing hex address display bug when editing transaction (#15873)

feature/default_network_editable
ryanml 2 years ago committed by GitHub
parent b5049a1736
commit c8935c6951
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      ui/ducks/send/send.js
  2. 6
      ui/ducks/send/send.test.js
  3. 2
      ui/pages/send/send-content/add-recipient/add-recipient.component.js

@ -1714,8 +1714,10 @@ export function editExistingTransaction(assetType, transactionId) {
...draftTransactionInitialState.recipient,
address: transaction.txParams.to,
nickname:
getAddressBookEntryOrAccountName(state, transaction.txParams.to)
?.name ?? '',
getAddressBookEntryOrAccountName(
state,
transaction.txParams.to,
) ?? '',
},
amount: {
...draftTransactionInitialState.amount,
@ -1739,8 +1741,7 @@ export function editExistingTransaction(assetType, transactionId) {
const tokenAmountInDec =
assetType === ASSET_TYPES.TOKEN ? getTokenValueParam(tokenData) : '1';
const address = getTokenAddressParam(tokenData);
const nickname =
getAddressBookEntryOrAccountName(state, address)?.name ?? '';
const nickname = getAddressBookEntryOrAccountName(state, address) ?? '';
const tokenAmountInHex = addHexPrefix(
conversionUtil(tokenAmountInDec, {

@ -2460,7 +2460,7 @@ describe('Send Slice', () => {
recipient: {
address: '0xRecipientAddress',
error: null,
nickname: '',
nickname: '0xRecipientAddress',
warning: null,
recipientWarningAcknowledged: false,
type: '',
@ -2605,7 +2605,7 @@ describe('Send Slice', () => {
recipient: {
address: BURN_ADDRESS,
error: null,
nickname: '',
nickname: BURN_ADDRESS,
warning: null,
type: '',
recipientWarningAcknowledged: false,
@ -2797,7 +2797,7 @@ describe('Send Slice', () => {
address: BURN_ADDRESS,
error: null,
warning: null,
nickname: '',
nickname: BURN_ADDRESS,
type: '',
recipientWarningAcknowledged: false,
},

@ -28,7 +28,7 @@ export default class AddRecipient extends Component {
isUsingMyAccountsForRecipientSearch: PropTypes.bool,
recipient: PropTypes.shape({
address: PropTypes.string,
nickname: PropTypes.nickname,
nickname: PropTypes.string,
error: PropTypes.string,
warning: PropTypes.string,
}),

Loading…
Cancel
Save