Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev-asf-parent' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Asherda committed Dec 11, 2024
2 parents e71ace8 + 58d9d9e commit e8f959a
Showing 1 changed file with 43 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -577,33 +577,35 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor
}
}

for (const coinId in activeAccount.keys) {
if (activeAccount.keys[coinId] && (activeAccount.keys[coinId][ETH] || activeAccount.keys[coinId][ERC20])) {
const ethAddresses = activeAccount.keys[coinId][ETH] ?
activeAccount.keys[coinId][ETH].addresses : activeAccount.keys[coinId][ERC20].addresses;

if (ethAddresses && ethAddresses.length > 0) {
const addr = ethAddresses[0];
const addrTitle = addr.substring(0, 8) + '...' + addr.substring(addr.length - 8);

if (!seen.has(addr)) {
seen.add(addr);
addresses.push({
title: addrTitle,
logoid: coinsList.ETH.id,
key: addr,
description: addr,
values: {
[SEND_MODAL_TO_ADDRESS_FIELD]: addr
},
right: "",
keywords: [
addr
]
})
if (!sendModal.data[SEND_MODAL_IS_PRECONVERT]) {
for (const coinId in activeAccount.keys) {
if (activeAccount.keys[coinId] && (activeAccount.keys[coinId][ETH] || activeAccount.keys[coinId][ERC20])) {
const ethAddresses = activeAccount.keys[coinId][ETH] ?
activeAccount.keys[coinId][ETH].addresses : activeAccount.keys[coinId][ERC20].addresses;

if (ethAddresses && ethAddresses.length > 0) {
const addr = ethAddresses[0];
const addrTitle = addr.substring(0, 8) + '...' + addr.substring(addr.length - 8);

if (!seen.has(addr)) {
seen.add(addr);
addresses.push({
title: addrTitle,
logoid: coinsList.ETH.id,
key: addr,
description: addr,
values: {
[SEND_MODAL_TO_ADDRESS_FIELD]: addr
},
right: "",
keywords: [
addr
]
})
}

break;
}

break;
}
}
}
Expand Down Expand Up @@ -667,9 +669,11 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor
case SEND_MODAL_MAPPING_FIELD:
newSuggestionsBase = await processMappingSuggestionPaths(flatPaths, sendModal.coinObj);
setSuggestionBase(newSuggestionsBase);
break;
case SEND_MODAL_TO_ADDRESS_FIELD:
newSuggestionsBase = processSelfSuggestionPaths();
setSuggestionBase(newSuggestionsBase);
break;
default:
setSuggestionBase(newSuggestionsBase);
break;
Expand Down Expand Up @@ -1037,13 +1041,17 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor
fillAmount(BigNumber(spendableBalance));
};

const setAddressSelf = () => {
const addr = addresses.results[0]

updateSendFormData(
SEND_MODAL_TO_ADDRESS_FIELD,
addr
);
const handleSelfPressed = () => {
if (allSubWallets[coinsList.VRSC.id]) {
handleFieldFocus(SEND_MODAL_TO_ADDRESS_FIELD);
} else {
const addr = addresses.results[0]

updateSendFormData(
SEND_MODAL_TO_ADDRESS_FIELD,
addr
);
}
};

return localBalances == null ? (<AnimatedActivityIndicatorBox />) : (
Expand Down Expand Up @@ -1190,7 +1198,7 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor
onRecipientAddressChange={text =>
updateSendFormData(SEND_MODAL_TO_ADDRESS_FIELD, text)
}
onSelfPress={() => handleFieldFocus(SEND_MODAL_TO_ADDRESS_FIELD)}
onSelfPress={() => handleSelfPressed()}
amountValue={sendModal.data[SEND_MODAL_AMOUNT_FIELD]}
onAmountChange={text =>
updateSendFormData(SEND_MODAL_AMOUNT_FIELD, text)
Expand All @@ -1200,6 +1208,7 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor
networkName={networkName}
estimatedResultSubtitle={
isConversion &&
!isExport &&
sendModal.data[SEND_MODAL_PRICE_ESTIMATE] != null &&
processedAmount != null
? `≈ ${Number(
Expand Down

0 comments on commit e8f959a

Please sign in to comment.