Skip to content

Commit

Permalink
fix fetchUserPositions should use window.adrena.client.readonlyConnec…
Browse files Browse the repository at this point in the history
…tion

although the user positions are only fetched after user's wallet is connected,
the AdrenaClient.connection (from the user-scoped program's provider attached to the client),
may not yet be available.

this is fine because we still have the read-only program available, we can fetch positions.
  • Loading branch information
0xcryptovenom committed Nov 26, 2024
1 parent 6218167 commit b56b349
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/actions/thunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const fetchUserPositions =
dispatch: Dispatch,
getState: () => RootState,
): Promise<Array<PositionExtended> | null> => {
const connection = window.adrena.client.connection;
const connection = window.adrena.mainConnection;
const walletPublicKey = selectWalletPublicKey(getState());
const possibleUserPositions = selectPossibleUserPositions(getState());

Expand Down

0 comments on commit b56b349

Please sign in to comment.