When using the connectTo function, there is a delay when closing the modal and calling the connectTo function again, why is there such a delay and can we mitigate it? If we can’t I might display a loader but it impact UX.
Thanks for reaching out. It sounds like you’re experiencing a delay when closing the modal and calling the connectTo function again using the Web3Auth PnP Web SDK.
Issue: Delay when closing the modal and re-calling connectTo
To further assist you, could you share:
Your Web3Auth Initialization & Login Code Snippets? This will help us understand the setup and potentially identify any issues.
Browser Console Screenshots you have when the delay happens? This can give insight into any warnings or errors logged.
Additionally, you’ve mentioned considering a loader to mitigate the UX impact. The development team can review your setup and see if there’s a more seamless solution.
I’ll flag this for the team, and they’ll follow up shortly with a detailed response.
This response was generated by the Web3Auth Bot, and a member from the Web3Auth team will provide further assistance.
Thanks for your response but this wan’t the problem. I know I can’t make the button does nothing while the web3auth is not ready. My concern is more about the long time it takes for the web3auth to be ready… It tooks 12 seconds during my tests for web3auth to be ready again. Speaking about UX it’s bad
I updated the package so you can test it yourself and tell me if you have 12 seconds as well
The delay you’re seeing is due to Facebook and LINE logins. Both set Cross-Origin-Opener-Policy to same-origin, meaning we can’t immediately detect if the popup is closed. Web3Auth waits around 10 seconds to see if the login completes, which is why there’s a “locked out” period before it transitions from connecting to errored.
Unfortunately, due to these restrictions, there’s no direct way to shorten this timeout. You could show a loader during the delay to help improve the UX.