mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-13 19:16:52 +01:00
wip
This commit is contained in:
parent
8719ded414
commit
2f3ac6e972
2 changed files with 15 additions and 2 deletions
|
@ -137,6 +137,8 @@
|
|||
"details_add_rec_rem_all": "Remove All Recipients",
|
||||
"details_recipients_title": "Recipients",
|
||||
"details_recipient_title": "Recipient #{number} of #{total}",
|
||||
"please_complete_recipient_title": "Incomplete Recipient",
|
||||
"please_complete_recipient_details": "Please complete the details of recipient #{number} before adding a new recipient.",
|
||||
"details_address": "Address",
|
||||
"details_address_field_is_not_valid": "The address is not valid.",
|
||||
"details_adv_fee_bump": "Allow Fee Bump",
|
||||
|
|
|
@ -921,11 +921,22 @@ const SendDetails = () => {
|
|||
};
|
||||
|
||||
const handleAddRecipient = () => {
|
||||
// Check if any recipient is incomplete (missing address or amount)
|
||||
const incompleteIndex = addresses.findIndex(item => !item.address || !item.amount);
|
||||
if (incompleteIndex !== -1) {
|
||||
scrollIndex.current = incompleteIndex;
|
||||
scrollView.current?.scrollToIndex({ index: incompleteIndex, animated: true });
|
||||
presentAlert({
|
||||
title: loc.send.please_complete_recipient_title,
|
||||
message: loc.formatString(loc.send.please_complete_recipient_details, { number: incompleteIndex + 1 }),
|
||||
});
|
||||
return;
|
||||
}
|
||||
// Add new recipient as usual if all recipients are complete
|
||||
setAddresses(prevAddresses => [...prevAddresses, { address: '', key: String(Math.random()) } as IPaymentDestinations]);
|
||||
|
||||
// Wait for the state to update before scrolling
|
||||
setTimeout(() => {
|
||||
scrollIndex.current = addresses.length; // New index is at the end of the list
|
||||
scrollIndex.current = addresses.length; // New index at the end
|
||||
scrollView.current?.scrollToIndex({
|
||||
index: scrollIndex.current,
|
||||
animated: true,
|
||||
|
|
Loading…
Add table
Reference in a new issue