Skip to content

Commit

Permalink
fix: improved state fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
k0beLeenders committed Dec 11, 2024
1 parent ef806df commit 6f80a48
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions apps/marginfi-v2-trading/src/context/TradeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export const TradePovider: React.FC<{
state.initialized,
state.hydrationComplete,
]);

const [fetchPriorityFee] = useUiStore((state) => [state.fetchPriorityFee]);
const [isLoggedIn, setIsLoggedIn] = React.useState(false);

React.useEffect(() => {
Expand All @@ -42,18 +40,12 @@ export const TradePovider: React.FC<{
}, [fetchArenaGroups, hydrationComplete, setHydrationComplete]);

React.useEffect(() => {
if (!initialized) {
console.log("fetching arena groups");
fetchArenaGroups();
}
}, [fetchArenaGroups, initialized]);

React.useEffect(() => {
if (initialized) {
if (initialized || connected) {
console.log("fetching extended arena groups");
fetchExtendedArenaGroups({ connection, wallet });
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [initialized, wallet]);
}, [initialized, connected]);

React.useEffect(() => {
const trackReferral = async (referralCode: string, walletAddress: string) => {
Expand Down

0 comments on commit 6f80a48

Please sign in to comment.