Skip to content

Commit 46296fc

Browse files
committed
fix bank sort by tier
1 parent 65c622d commit 46296fc

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

pages/dashboard/index.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,16 @@ const Dashboard: NextPage = () => {
194194

195195
const sortByTier = (tier: string | undefined) => {
196196
const tierOrder: Record<string, number> = {
197-
AAA: 0,
198-
AA: 1,
199-
A: 2,
200-
'A-': 3,
201-
BBB: 4,
202-
BB: 5,
203-
B: 6,
204-
C: 7,
197+
S: 0,
198+
AAA: 1,
199+
AA: 2,
200+
A: 3,
201+
'A-': 4,
202+
BBB: 5,
203+
BB: 6,
204+
B: 7,
205+
C: 8,
206+
D: 9,
205207
}
206208
if (tier) {
207209
return tierOrder[tier]
@@ -272,8 +274,6 @@ const Dashboard: NextPage = () => {
272274
<div className="border-b border-th-bkg-3">
273275
{banks
274276
.sort((a, b) => {
275-
const aTier = getSuggestedAndCurrentTier(a, midPriceImp)
276-
const bTier = getSuggestedAndCurrentTier(b, midPriceImp)
277277
const aIsReduceOnly = a.areDepositsReduceOnly()
278278
const bIsReduceOnly = b.areDepositsReduceOnly()
279279
if (aIsReduceOnly && !bIsReduceOnly) {
@@ -282,8 +282,8 @@ const Dashboard: NextPage = () => {
282282
return -1
283283
} else {
284284
return (
285-
sortByTier(aTier?.currentTier?.preset_name) -
286-
sortByTier(bTier?.currentTier?.preset_name)
285+
sortByTier(a.tier) -
286+
sortByTier(b.tier)
287287
)
288288
}
289289
})

0 commit comments

Comments
 (0)