This is what I have right now, but it’s spamming the user when the user denied to connect his wallet.
useEffect(() => {
(async () => {
try {
if (!isInitialized) {
initialize({
appId: ###########
serverUrl: ##########
});
}
if (isInitialized && !isWeb3Enabled) {
try {
const wc = window as WindowChain;
const provider = wc.ethereum;
if (window.localStorage.walletconnect) {
await enableWeb3({
provider: "walletconnect"
})
} else
if (provider) {
await enableWeb3()
}
} catch (e) {
console.log(e)
}
}
if (isInitialized && isWeb3Enabled)
await getProperty();
} catch (error) {
setPropertyData(myData)
console.log("error", error);
}
}
)()
}, [isWeb3Enabled, isInitialized])