Skip to content

Commit

Permalink
fix(frontend): reduced glimpsing
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaiYurchenko committed Aug 15, 2023
1 parent 35bec56 commit bbafd19
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,20 @@ function VaultSelect({ type = VaultType.BORROW }: VaultSelectProps) {

useEffect(() => {
if (type === VaultType.BORROW) return;
setIsLoading(true);
// We want to make sure to only set the selected route if we have no previous value
if (activeVault && prevVault.current === undefined) {
prevVault.current = activeVault;
setSelectedRoute(preselect());
}
setOpenedRoute(null);
setUnFolded(false);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [activeVault, collateral.currency.wrapped.symbol, router.pathname, type]);

useEffect(() => {
if (type === VaultType.LEND) return;
setIsLoading(true);
// setSelectedRoute(2);
setOpenedRoute(null);
setUnFolded(false);
}, [
collateral.chainId,
debt?.chainId,
Expand All @@ -165,8 +164,6 @@ function VaultSelect({ type = VaultType.BORROW }: VaultSelectProps) {

if (hasNoAvailableVaults) return null;

console.warn(activeVault?.chainId, selectedRoute);

return (
<Stack
sx={
Expand Down

0 comments on commit bbafd19

Please sign in to comment.