You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
I am building a project using Algosigner and React and I followed the code given in the article Integrate AlgoSigner to JavaScript Application on Algorand
Code snippet:
useEffect(()=>{if(typeofwindow.AlgoSigner!=="undefined"){// connects to the browser AlgoSigner instancewindow.AlgoSigner.connect()// finds the TestNet accounts currently in AlgoSigner.then(()=>window.AlgoSigner.accounts({ledger: "TestNet",})).then((accountData)=>{// the accountData object should contain the Algorand addresses from TestNet that AlgoSigner currently knows aboutconsole.log(accountData);}).catch((e)=>{// handle errors and perform error cleanup hereconsole.error(e);});}else{console.log(window.AlgoSigner);}},[]);
On opening the application for the first time, everything works fine. The accounts addresses get logged on the console.
However, on refreshing the page, the useEffect runs again and window.Algosigner is undefined.