Question: best way to determine if the modal will/will not appear?
See original GitHub issueSorry if there’s a more appropriate place to ask this question!
I’m trying to develop the following UX on web3Modal:
- The user comes to site A for the first time
- The user clicks “connect”, sees the web3modal, selects a provider
- The user’s provider is cached
- The user refreshes the page
- The user is “auto-connected”
The docs seemed to point to using the cachedProvider
property to determine this, but in some cases, cachedProvider
returns true
, and the modal still appears.
The problem here is that this ends up resulting in some users refreshing their page, and then the metamask popup immediately opening, which is obviously poor UX.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Can I check if Bootstrap Modal Shown / Hidden?
The best method is given in the docs $('#myModal').on('shown.bs.modal', function () { // will only come inside after the modal is shown });....
Read more >No more mistakes with MODALS! 3 Easy Rules - YouTube
In this lesson you' ll learn how to use modal verbs properly, and how to avoid ... Right ? Okay. So, let's look...
Read more >English Grammar: How to Use “will”
Grammar rules "Will" and the negative form "will not" or "won't" is a modal auxiliary verb. This means that there is no s...
Read more >Modals - UNC Writing Center
Modal verbs (will, would, should, may, can, could, might, must) precede another verb. Modals do not have subject-verb agreement or take the infinitive...
Read more >Grammar: Modal Verbs – Coalescence
First, modal verbs add meaning to another verb. You don't usually use a modal verb by itself unless the main verb is implied...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is what I thought too initially, but the problem is that calling
this.web3Modal.connect()
does open the model sometimes, even whencachedProvider
istrue
. The result is that a user coming to the site will immediately see the popup on page load, which is an unintended behavior.What i’m specifically looking for is something like:
I specifically do not want to call
connect
insidecomponentDidMount
if the modal will open - whencachedProvider
istrue
, sometimes the modal still opens.Thank you again for your help on this specific question.
@Schwartz10 How did you end up doing it? I am facing this too right now