Skip to content

Commit 34ecd9f

Browse files
linkielinkPatricie29dependabot[bot]StefChatz
authored
v3.0.8 (#1757)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Patricie <99055449+Patricie29@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Patricie29 <patricie@marsprotocol.foundation> Co-authored-by: Monkmansteve <sxatzakis@yahoo.gr> Co-authored-by: Monkmansteve <47855432+StefChatz@users.noreply.github.com>
1 parent 804aa67 commit 34ecd9f

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/components/borrow/Table/useBorrowMarketAssetsTableData.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ export default function useBorrowMarketAssetsTableData() {
1818
availableAssets: BorrowMarketTableData[] = []
1919

2020
markets
21-
.filter((market) => market.borrowEnabled)
21+
.filter((market) => {
22+
// Include markets where borrows are enabled OR where user has active debt
23+
const hasActiveDebt =
24+
account?.debts?.find((debt) => debt.denom === market.asset.denom)?.amount?.gt(BN_ZERO) ??
25+
false
26+
return market.borrowEnabled || hasActiveDebt
27+
})
2228
.forEach((market) => {
2329
const amount =
2430
account?.debts?.find((debt) => debt.denom === market.asset.denom)?.amount ?? BN_ZERO

src/components/v1/Table/useV1BorrowingsTableData.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ export default function useV1BorrowingsTableData() {
1616
const debtAssets: BorrowMarketTableData[] = []
1717

1818
markets
19-
.filter((market) => market.borrowEnabled)
19+
.filter((market) => {
20+
// Include markets where borrows are enabled OR where user has active debt
21+
const hasActiveDebt =
22+
userDebts.find((debt) => debt.denom === market.asset.denom)?.amount?.gt(BN_ZERO) ?? false
23+
return market.borrowEnabled || hasActiveDebt
24+
})
2025
.forEach((market) => {
2126
const amount =
2227
userDebts.find((debt) => debt.denom === market.asset.denom)?.amount ?? BN_ZERO

0 commit comments

Comments
 (0)