Skip to content

Commit

Permalink
fix acct loading
Browse files Browse the repository at this point in the history
  • Loading branch information
tlrjs committed Sep 20, 2023
1 parent 32016c2 commit 3a714ff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions hooks/useAccountHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const fetchHistory = async (

export default function useAccountHistory() {
const { mangoAccount } = useMangoAccount()
console.log('mango account in history', mangoAccount)

const response = useQuery<Array<ActivityFeed> | EmptyObject | null>(
['history'],
Expand Down
10 changes: 8 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ const Index: NextPage = () => {
useEffect(() => {
const mangoAccounts = mangoStore.getState().mangoAccounts
const selectedMangoAccount = mangoAccounts.find(
(ma) => ma.name === `${BOOST_ACCOUNT_PREFIX}${selectedToken}`,
(ma) =>
ma.name.toLowerCase() ===
`${(BOOST_ACCOUNT_PREFIX + selectedToken).toLowerCase()}`,
)
console.log(
'selectedMangoAccount',
(BOOST_ACCOUNT_PREFIX + selectedToken).toLowerCase(),
selectedMangoAccount,
)
console.log('selectedMangoAccount', selectedMangoAccount)

set((s) => {
s.mangoAccount.current = selectedMangoAccount
Expand Down
2 changes: 1 addition & 1 deletion utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const SHOW_INACTIVE_POSITIONS_KEY = 'showInactivePositions-0.1'

export const LAST_ACCOUNT_KEY = 'mangoAccount-0.4'

export const BOOST_ACCOUNT_PREFIX = 'Leverage Stake'
export const BOOST_ACCOUNT_PREFIX = 'Leverage Stake '

export const CLIENT_TX_TIMEOUT = 90000

Expand Down

0 comments on commit 3a714ff

Please sign in to comment.