This repository has been archived by the owner on Sep 6, 2023. It is now read-only.
Detect metamask lock state #109
mihoward21
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Unfortunately there isn't a good way to tell if an injected wallet (or specifically MetaMask) is locked like this. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have my code setup to autoconnect, and generally that works well. I show a loading spinner until the autoconnect has completed (at which point they get a personalized view of the app), or I get confirmation the user is not connected (at which point they get a generic view of the app).
One issue I've been having is with a logged out/locked state on metamask. I'm detecting the user as connected, so it's trying to autoconnect. But I have to wait for them to enter their metamask password so they just get this super long loading spinner. And sometimes the metamask extension doesn't pop-up the login window (it's pretty rare and seems random-ish when that happens).
In this particular state, I'd like to show the user the generic view of the app until they have logged into metamask, at which point they'll get their personalized view. The problem is I can't find a way to detect when the user is in this locked state. I don't want to always show the generic view until they are connected, because in the proper autoconnect flow that will basically show a quick flash on the page which I'd like to avoid.
Anyway, not sure if that explanation makes sense. Happy to clarify anything. If this is something the wagmi team can support that would be amazing! Otherwise if anyone has any suggestions on how to detect this it would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions