Skip to content

Commit

Permalink
fix(investor-box): update Main-InvestBox.svelte
Browse files Browse the repository at this point in the history
apply fix for Main-InvestBox.svelte regarding invorrect `BTA` calculation, and correct discount tier
factoring-in. Also, slight correction for case of `null` for `depositAmount` correction from
previous issue.

fix #1841; fix #1851;
  • Loading branch information
migbash committed Dec 1, 2023
1 parent d942ae2 commit 4c7f9f2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib/components/page/profile/investor/Main-InvestBox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,11 @@
tierDiscountObject.icon = icon_bronze;
tierDiscountObject.discount = 20;
}
else if ([undefined, null, 0].includes(depositAmount))
else if (depositAmount < 2500)
{
depositAmount = 0;
tierDiscountObject.name = null;
tierDiscountObject.icon = null;
tierDiscountObject.discount = 0;
}
/**
Expand All @@ -612,8 +614,8 @@
$:
{
// ▓ NOTE:
// ▓ > relation between deposit and recieve.
recieveAmount = parseFloat(toDecimalFix(depositAmount * cryptoPrice, 2));
// ▓ > relation between (1) deposit, (2) exchange price, (3) discount to obtain recieveAmount.
recieveAmount = parseFloat(toDecimalFix(depositAmount * cryptoPrice * (1 + (tierDiscountObject.discount / 100)), 2));
}
/**
Expand Down Expand Up @@ -1105,7 +1107,7 @@
>
<!-- ▓ [🐞] -->
<!-- {console.log(cryptoPrices?.data?.['USDC']?.quote?.USD?.price)} -->
{depositAmount} {cryptoDepositOptionSelect?.name} ≈ {cryptoPrice ?? '-'} $
{depositAmount ?? 0} {cryptoDepositOptionSelect?.name} ≈ {cryptoPrice ?? '-'} $
</p>

</div>
Expand Down

0 comments on commit 4c7f9f2

Please sign in to comment.