Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Dashboard notify user if no Frame account is / can be connected #6071

Merged
merged 2 commits into from
Jun 6, 2023

Conversation

cliffoo
Copy link
Contributor

@cliffoo cliffoo commented Jun 5, 2023

Thanks to curiousapple.eth and @pcaversaccio for bring up the underlying issue!

When using Frame with Dashboard, Dashboard doesn't know what to do if no Frame account is connected. This PR sidesteps wagmi and finds out if that's the case, provides a helpful notification asking the user to connect a Frame account, and hides the notification when Dashboard is ready.

Environment: Frame v0.6.6 (amd64, deb), Frame Companion v0.10.2 (Chrome).

Tested with Frame Companion's two options: Injecting as Frame / MetaMask.

@cliffoo cliffoo requested a review from gnidan June 5, 2023 21:56
Copy link
Contributor

@gnidan gnidan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice, so that's what was wrong!

Does everything else work when the account is connected properly?

@cliffoo
Copy link
Contributor Author

cliffoo commented Jun 5, 2023

From a few test transactions it looks like it. Though I did just discover an unhandled case: If you deny connection in Frame, Dashboard does nothing again because Frame remembers that you denied connection to this host.

The fix would be the same. @gnidan Should we generalize this instead of having checking for more regex? The notification can just be titled "Wallet connection error" and we can put err.message in notification body.

In this case err.message would be "Permission denied, approve localhost:24012 in Frame to continue"

@gnidan
Copy link
Contributor

gnidan commented Jun 5, 2023

Should we generalize this instead of having checking for more regex?

I'm not sure we should generalize this... it might be alright to generalize as "something is wrong with Frame, go check", but I think it's just nicer to specify what is wrong when we know.

@cliffoo cliffoo requested a review from gnidan June 6, 2023 14:14
@cliffoo cliffoo merged commit d9fdb70 into develop Jun 6, 2023
10 checks passed
@cliffoo cliffoo deleted the dash-frame-alert branch June 6, 2023 18:30
@cliffoo cliffoo changed the title Dashboard notify user if no Frame account is connected Dashboard notify user if no Frame account is / can be connected Jun 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants