Skip to content

Commit

Permalink
fix: write off logic
Browse files Browse the repository at this point in the history
  • Loading branch information
JP Angelle committed Nov 22, 2023
1 parent 12d40cb commit b2dde7d
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions tinlake-ui/components/Loan/Data/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,24 +199,16 @@ const LoanData: React.FC<Props> = (props: Props) => {
<TableRow>
<TableCell scope="row">Total repaid</TableCell>
<TableCell style={{ textAlign: 'end' }}>
{console.log(loanData?.threshold.toString())}
<LoadingValue done={!isLoanDataLoading}>
{addThousandsSeparators(
isBTPool && writeOffPercentageData === '100'
? toPrecision(
baseToDisplay(
new BN(loanData?.borrowsAggregatedAmount || new BN(0)).add(
props.loan?.debt || new BN(0)
) || new BN(0),
18
),
2
)
: toPrecision(baseToDisplay(loanData?.repaysAggregatedAmount || new BN(0), 18), 2)
toPrecision(baseToDisplay(loanData?.repaysAggregatedAmount || new BN(0), 18), 2)
)}{' '}
{props.poolConfig.metadata.currencySymbol || 'DAI'}
</LoadingValue>
</TableCell>
</TableRow>
{console.log(loanData)}
{isBTPool && writeOffPercentageData === '100' && (
<TableRow>
<TableCell scope="row">Written off</TableCell>
Expand Down

0 comments on commit b2dde7d

Please sign in to comment.