FIX: rare alert that recipients list can't be empty

This commit is contained in:
Overtorment 2021-06-09 14:51:53 +01:00
parent 256fecb97b
commit 9a705c84ce

View file

@ -497,7 +497,13 @@ const SendDetails = () => {
};
await saveToDisk();
const recipients = outputs.filter(({ address }) => address !== changeAddress);
let recipients = outputs.filter(({ address }) => address !== changeAddress);
if (recipients.length === 0) {
// special case. maybe the only destination in this transaction is our own change address..?
// (ez can be the case for single-address wallet when doing self-payment for consolidation)
recipients = outputs;
}
navigation.navigate('Confirm', {
fee: new BigNumber(fee).dividedBy(100000000).toNumber(),