mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
fix: total balance can be equal to the amount, access undefined with ?
This commit is contained in:
parent
e08603a42a
commit
cf4d888ad5
1 changed files with 2 additions and 2 deletions
|
|
@ -348,7 +348,7 @@ route.post('/nutzap', userMiddleware({ enc: 'nip44' }), async (c) => {
|
||||||
let selectedMint: string | undefined;
|
let selectedMint: string | undefined;
|
||||||
|
|
||||||
for (const mint of recipientMints) {
|
for (const mint of recipientMints) {
|
||||||
if (organizedProofs[mint].totalBalance > amount) {
|
if (organizedProofs[mint]?.totalBalance >= amount) {
|
||||||
selectedMint = mint;
|
selectedMint = mint;
|
||||||
let minimumRequiredBalance = 0;
|
let minimumRequiredBalance = 0;
|
||||||
|
|
||||||
|
|
@ -357,7 +357,7 @@ route.post('/nutzap', userMiddleware({ enc: 'nip44' }), async (c) => {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minimumRequiredBalance > amount) {
|
if (minimumRequiredBalance >= amount) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue