Vue3 project. Is there a way I can tell whether or not the wallet is connected #4528
Answered
by
Supermutecx
s3mi0tics
asked this question in
web3modal-sdk-support
-
I would like to change the UI of my application if there is a successful wallet connection. Is there a way I can add a listener event that will tell me whether or not the wallet has created a successful connection? I notice the button changes. |
Beta Was this translation helpful? Give feedback.
Answered by
Supermutecx
May 10, 2024
Replies: 1 comment
-
@s3mi0tics, Web3Modal provides the hook that can check the wallet is connected or not. ` const { address, chainId, isConnected } = useWeb3ModalAccount() Based on the isConnected status, you can update the button or not. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
glitch-txs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@s3mi0tics, Web3Modal provides the hook that can check the wallet is connected or not.
`
import { useWeb3ModalAccount } from '@web3modal/ethers/vue'
const { address, chainId, isConnected } = useWeb3ModalAccount()
`
Based on the isConnected status, you can update the button or not.