Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: QR code not displayed on first attempt to connect via Wallet Connect on desktop / chromium browsers #2279

Merged
merged 3 commits into from
Feb 8, 2024

Conversation

blushi
Copy link
Member

@blushi blushi commented Feb 6, 2024

Description

Closes: #2275

There was something weird happening with our existing implementation (custom). It was working fine in most browsers (Firefox, Safari), except chromium based browsers when the dev tools wasn't open for some reason (#2275 (comment)).
So instead I've set it up so that we define a customModal for the cosmos-kit ChainProvider, this modal only gets displayed when trying to connect with wallet connect, since we only use cosmos-kit for that so far. This also seems like a cleaner solution anyway, which involves less custom code (see code diff stats).


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • provided a link to the relevant issue or specification
  • provided instructions on how to test
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

How to test

  1. Go to https://deploy-preview-2279--regen-marketplace.netlify.app/ from desktop
  2. Click the login button and try to connect with Wallet Connect
  3. You should see the QR code
  4. Scan from Keplr mobile and approve
  5. You should be connected

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items
.

I have...

  • confirmed all author checklist items have been addressed
  • reviewed code correctness and readability
  • verified React components follow DRY principles
  • reviewed documentation is accurate
  • reviewed tests
  • manually tested (if applicable)

Copy link

netlify bot commented Feb 6, 2024

Deploy Preview for regen-website ready!

Name Link
🔨 Latest commit 6bffaa4
🔍 Latest deploy log https://app.netlify.com/sites/regen-website/deploys/65c49948793adc0009ea1f3f
😎 Deploy Preview https://deploy-preview-2279--regen-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

<WalletProvider>
<LedgerProvider>
<ThemeProvider>
<ThemeProvider>
Copy link
Member Author

@blushi blushi Feb 6, 2024

Choose a reason for hiding this comment

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

we needed to move the ThemeProvider up so the LoginModalMobile provided as walletModal to ChainProvider renders with our MUI theme

@blushi blushi requested a review from a team February 6, 2024 16:33
@blushi
Copy link
Member Author

blushi commented Feb 6, 2024

@paul121 @erikalogie please see testing instructions above

@blushi blushi requested a review from paul121 February 6, 2024 16:40
Copy link
Contributor

@paul121 paul121 left a comment

Choose a reason for hiding this comment

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

This is better... although I did experience the same issue the very first time I loaded the page and clicked WC. Loading the page again, however, and it works. You can test this in an incognito window. Clearing local storage for this site will also "reset" this and cause the error on next load.

The modal doesn't seem to have everything it needs the first time it loads. But subsequent loads are fine. I think it makes sense how these changes fixed the subsequent loads. Any idea for the first load?

@aaronc
Copy link
Member

aaronc commented Feb 6, 2024

When I tested in Safari, the modal got stuck on the loading animation the first time I tried this. Then the second time I clicked, I saw a QR code right away.

@blushi
Copy link
Member Author

blushi commented Feb 7, 2024

@paul121 @aaronc this should be fixed now

@blushi blushi requested a review from paul121 February 7, 2024 10:43
@erikalogie
Copy link
Collaborator

LGTM!

@blushi blushi force-pushed the fix-2275-wc-qrcode branch from 96a9241 to 0cda117 Compare February 8, 2024 08:48
@blushi blushi force-pushed the fix-2275-wc-qrcode branch from 0cda117 to 6bffaa4 Compare February 8, 2024 09:05
@blushi blushi merged commit 69b330a into dev Feb 8, 2024
14 checks passed
@blushi blushi deleted the fix-2275-wc-qrcode branch February 8, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue connecting to WC from desktop
4 participants