MCPcopy Index your code
hub / github.com/Shmoji/web3-react-example / connectWalletOnPageLoad

Function connectWalletOnPageLoad

pages/index.js:27–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26 useEffect(() => {
27 const connectWalletOnPageLoad = async () => {
28 if (localStorage?.getItem('isWalletConnected') === 'true') {
29 try {
30 await activate(injected)
31 localStorage.setItem('isWalletConnected', true)
32 } catch (ex) {
33 console.log(ex)
34 }
35 }
36 }
37 connectWalletOnPageLoad()
38 }, [])
39

Callers 1

HomeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected