Skip to content

Commit

Permalink
Fix offer selection on borrow
Browse files Browse the repository at this point in the history
  • Loading branch information
sablevsky committed Dec 24, 2024
1 parent 793b868 commit 12056cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/core/offers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ const spreadToSimpleOffers = (
const loanValue = calculateMaxLoanValueFromOffer(offer)
const loansAmount = сalculateLoansAmount(offer)

const simpleOffers: SimpleOffer[] = new Array(loansAmount).fill({
//? Need to use map to call uniqueId for each offer to prevent same id generation
const simpleOffers: SimpleOffer[] = new Array(loansAmount).fill(null).map(() => ({
id: uniqueId(),
loanValue,
hadoMarket: offer.hadoMarket,
publicKey: offer.publicKey,
assetReceiver: offer.assetReceiver,
})
}))

if (userVaultBalance === null) {
return simpleOffers
Expand Down

0 comments on commit 12056cc

Please sign in to comment.