From 4668116edf8e36b0ed899238192ffcf46ddf07ff Mon Sep 17 00:00:00 2001 From: polymorpher Date: Sun, 20 Oct 2024 07:59:22 -0700 Subject: [PATCH] address --- src/launch.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/launch.tsx b/src/launch.tsx index 6bca2c2..5b943d0 100644 --- a/src/launch.tsx +++ b/src/launch.tsx @@ -1,4 +1,4 @@ -import React, { useState, useRef } from 'react' +import React, { useState, useRef, useEffect } from 'react' import { Box, VStack, @@ -30,6 +30,7 @@ import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { chainOptions, type ChainOptionType } from './utils' import { ConnectButton } from '@rainbow-me/rainbowkit' +import { useAccount } from 'wagmi' const client = createPublicClient({ chain: mainnet, @@ -47,6 +48,7 @@ interface RecipeResponse { } const Launch = (): React.JSX.Element => { + const { address, chainId } = useAccount() const [prompt, setPrompt] = useState('') const [urlPath, setUrlPath] = useState('') const [recipe, setRecipe] = useState('') @@ -74,6 +76,10 @@ const Launch = (): React.JSX.Element => { const [hasDeployedToHarmony, setHasDeployedToHamony] = useState(false) const [hasDeployedToPolygon, setHasDeployedToPolygon] = useState(false) + useEffect(() => { + setIsWalletConnected(!!address) + }, [address]) + const generateRecipe = async (prompt: string): Promise => { setIsRecipeLoading(true) try {