Skip to content

Commit

Permalink
fix: handle network changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dOrgJelli committed Jan 26, 2024
1 parent f01d6a9 commit 1c3c5ef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions web/components/Strategy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,17 @@ export default function Strategy(props: {
const [isTransferPending, setIsTransferPending] = useState(false);
const network: NetworkName | undefined = getSupportedNetworkFromWallet(wallet);

console.log("network", network)

const tokens = network
? getTokensForNetwork(network)
: [];

useEffect(() => {
if (!token && tokens.length) {
if (tokens.length) {
setToken(tokens[0]);
}
}, [token, tokens]);
}, [tokens]);

const selectedStrategiesLength = currentStrategy.filter(
({ selected }) => selected
Expand All @@ -79,7 +81,7 @@ export default function Strategy(props: {
.filter(({ weight }) => weight)
.map(({ weight }) => ({
//TODO: Use real addresses
address: "0x0000000",
address: "0xB1B7586656116D546033e3bAFF69BFcD6592225E",
weight: weight as number,
}));

Expand Down

0 comments on commit 1c3c5ef

Please sign in to comment.