fix default margin account select
This commit is contained in:
parent
aa5355e70c
commit
330ef82a32
|
@ -282,9 +282,10 @@ export default function AccountBorrows() {
|
|||
<Td
|
||||
className={`px-6 py-3 whitespace-nowrap text-sm text-th-fgd-1`}
|
||||
>
|
||||
{selectedMangoGroup
|
||||
.getUiTotalDeposit(i)
|
||||
.toFixed(tokenPrecision[asset])}
|
||||
{(
|
||||
selectedMangoGroup.getUiTotalDeposit(i) -
|
||||
selectedMangoGroup.getUiTotalBorrow(i)
|
||||
).toLocaleString()}
|
||||
</Td>
|
||||
<Td
|
||||
className={`px-6 py-3 whitespace-nowrap text-sm text-th-fgd-1`}
|
||||
|
|
|
@ -267,13 +267,11 @@ const useMangoStore = create<MangoStore>((set, get) => ({
|
|||
)
|
||||
} else {
|
||||
const lastAccount = localStorage.getItem('lastAccountViewed')
|
||||
console.log(JSON.parse(lastAccount))
|
||||
state.selectedMarginAccount.current = lastAccount
|
||||
? marginAccounts.find(
|
||||
(ma) =>
|
||||
ma.publicKey.toString() === JSON.parse(lastAccount)
|
||||
)
|
||||
: sortedAccounts[0]
|
||||
|
||||
state.selectedMarginAccount.current =
|
||||
marginAccounts.find(
|
||||
(ma) => ma.publicKey.toString() === JSON.parse(lastAccount)
|
||||
) || sortedAccounts[0]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue