Skip to content

Commit

Permalink
chore: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
borcherd authored and chambaz committed Nov 21, 2024
1 parent 86ec84e commit 844bb91
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ export const LendBox = ({

const [lstDialogCallback, setLSTDialogCallback] = React.useState<(() => void) | null>(null);
const [additionalActionMessages, setAdditionalActionMessages] = React.useState<ActionMessageType[]>([]);
const [allowRefresh, setAllowRefresh] = React.useState(false);

// Cleanup the store when the wallet disconnects
React.useEffect(() => {
Expand Down Expand Up @@ -248,7 +247,6 @@ export const LendBox = ({
bank: selectedBank as ActiveBankInfo,
},
});
setAllowRefresh(true);
},
setIsError: () => {},
setIsLoading: (isLoading) => setIsLoading(isLoading),
Expand Down Expand Up @@ -316,7 +314,6 @@ export const LendBox = ({
bank: selectedBank as ActiveBankInfo,
},
});
setAllowRefresh(true);
},
setIsError: () => {},
setIsLoading: (isLoading) => setIsLoading(isLoading),
Expand Down Expand Up @@ -353,12 +350,10 @@ export const LendBox = ({
]);

React.useEffect(() => {
if (allowRefresh) {
if (marginfiClient) {
refreshSelectedBanks(banks);
setAllowRefresh(false);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [marginfiClient]);
}, [marginfiClient, banks, refreshSelectedBanks]);

return (
<>
Expand Down

0 comments on commit 844bb91

Please sign in to comment.