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(unlock-app): fix network switch #14064

Merged
merged 5 commits into from
Jun 18, 2024
Merged

fix(unlock-app): fix network switch #14064

merged 5 commits into from
Jun 18, 2024

Conversation

clemsos
Copy link
Member

@clemsos clemsos commented Jun 18, 2024

Description

Make things works properly when prompting to switch network in user web wallet

Issues

Fixes #
Refs #

Checklist:

  • 1 PR, 1 purpose: my Pull Request applies to a single purpose
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the docs to reflect my changes if applicable
  • I have added tests (and stories for frontend components) that prove my fix is effective or that my feature works
  • I have performed a self-review of my own code
  • If my code involves visual changes, I am adding applicable screenshots to this thread

Release Note Draft Snippet

@cla-bot cla-bot bot added the cla-signed label Jun 18, 2024
@clemsos clemsos requested review from julien51 and SVell June 18, 2024 11:17
@@ -96,7 +96,7 @@ export const useProvider = (config: any) => {
)) as unknown as ethers.BrowserProvider
} else {
await switchBrowserProviderNetwork(networkId)
walletServiceProvider = new ethers.BrowserProvider(pr.provider, 'any')
walletServiceProvider = new ethers.BrowserProvider(window.ethereum!)
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure this works with wallet connect or Coinbase wallet?

Copy link
Member Author

@clemsos clemsos Jun 18, 2024

Choose a reason for hiding this comment

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

for coinbase that approach should work https://docs.cdp.coinbase.com/wallet-sdk/docs/injected-provider/

but fails with WalletConnect indeed

@julien51 julien51 merged commit bfe1ef1 into master Jun 18, 2024
12 checks passed
@julien51 julien51 deleted the fix-network-switch branch June 18, 2024 14:25
julien51 pushed a commit that referenced this pull request Jun 18, 2024
* fix network switch

* remove unwanted console log

* cross-chain parse gas values properly

* recreate provider proplery

* cross chain: delete unwanted gas values
julien51 added a commit that referenced this pull request Jun 18, 2024
* Manual deploy as of commit:2c21135eb2fe5f56bad82c282c07c36ee49b9877

* fix(unlock-app): fixing decent serialization

* fix(unlock-app): fix paywall modal when closed (#14065)

fix for paywall modal when closed

* fix(unlock-app): fix network switch (#14064)

* fix network switch

* remove unwanted console log

* cross-chain parse gas values properly

* recreate provider proplery

* cross chain: delete unwanted gas values

* fix(unlock-app): use eip1193 when recreating wallet provider for wallet connect (#14068)

* use eip1193 to init provider on wallet connect

* clarify provider flow

---------

Co-authored-by: Clément Renaud <clement@unlock-protocol.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants