Warning: Suppressed stale connector activation [object Object]
I get this warning in the console when trying to connect to metamask in my react (next.js) app using activateBrowserWallet indirectly. The way I'm doing this is via a custom hook I made which provides me with a function which calls activateBrowserWallet in the background but which also keeps track of the current state of the connection. While this is only a warning the account prop returned by the useEthers hook doesn't seem to be updated without directly refreshing the page despite metamask being connected to the page.
My current work-around is directly using await window.ethereum.request({ method: 'eth_requestAccounts' }) and then immediately after calling activateBrowserWallet(). Let me know if you have any ideas on fixes or additional information you'd like me to provide.
I've got the same issue, while the warning doesn't bother me, it's a bit annoying having to refresh the webpage in order for account to be non-null after calling activateBrowserWallet.
I'm also encountering this.
I have tried to reproduce on current version of useDApp - 1.1.5.
I tried to do something like:
<DAppProvider config={config}>
<IndirectActivator />
<App />
</DAppProvider>
function App () {
// Main page, that displays the `account` from `useEthers`
}
function IndirectActivator () {
const { activateBrowserWallet } = useEthers()
// Activate browser wallet indirectly in a different component than the main one.
useEffect(() => {
setTimeout(() => {
activateBrowserWallet()
}, 2000)
}, [])
}
It seems like account is non-null without refreshing the page.
@Philogy @georgeroman @josh-richardson Do you have any more pointers on reproducing this? Or maybe the issue is resolved in a recent version?