Closed dkent600 closed 5 years ago
The idea of the fallback is for injected providers that haven't been added to the library or that don't support the normal specification. Opera is an example of it.
The problem that you have is that you don't want the injected provider to appear and when you supply disableInjectedProvider it is shown?
The problem that you have is that you don't want the injected provider to appear and when you supply disableInjectedProvider it is shown?
I would prefer that the fallback button not appear if it is only going to fail if the user selects it. If that is not possible, then I'd like to be able to hide it by setting disableInjectedProvider
, say, when I can't find window.web3
or window.ethereum
(anticipating on my own that it is going to fail).
There was a bug that didn't hide the injected provider using disableInjectedProvider
Cool, but best would still be if the Web3 button were not be displayed if there is no injected extension to work with. In that case it is worse than worthless, as it crashes.
What is the dApp expected to do in this situation? I'm not sure that expecting the dApp to know whether to disable extensions (even if that works now) is a friendly UX. (disableInjectedProvider: !((window as any).web3 || (window as any).ethereum)
) Would be better IMHO that Web3Connect be smarter on its own about when to show the fallback.
I'll open it again and check it out since what you describe should be the default functionality and shouldn't crash.
The problem is: "If you have no web3 injected provider it crashes"? right? @dkent600
@crisgarner
If you have no web3 injected provider it crashes
Yes, last i checked.
I think, this was fixed on the 1.0.0 release
@crisgarner So now I'm curious, when is the fallback provider supposed to be displayed? I'm having trouble now making it appear. Thanks.
Oh, with Opera, I see it, thanks
When there is no injected provider, Web3Connect used the "fallback" provider which is called "Web3", type "injected", check "isWeb3".
What is the point of this? In what typical conditions will this fallback succeed? Seems like it should not be displayed unless it has a chance to succeed. For me, it is showing up and failing. It is not even needed because I have Portis and Fortmatic showing (but not WalletConnect, and no extensions are available).
So to get rid of this, I tried supplying
disableInjectedProvider
and when I do, when the Modal comes up the fallback is not hidden (even though it is "injected"), and there is a console log message, even though I am passingtrue
:How can I cause this fallback to not be shown? Thanks.