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

Ledger Live fix connection errors #797

Merged
merged 5 commits into from
Nov 4, 2024

Conversation

r-czajkowski
Copy link
Contributor

@r-czajkowski r-czajkowski commented Oct 29, 2024

Depends on: #780

This PR fixes Ledger Live wallet connection bug. If the user rejects the login message signing and closes the modal, they should get back to the initial state of the not-connected account.

Steps to recreate the bug:

  1. Open the account connection.
  2. Select a supported account.
  3. Cancel login message signing and clse the connection modal.
  4. The dApp looks like it is connected to an account, but after switching the account, it shows a "Something went wrong" error.

Disconnect connector on close modal button when the message is not
signed. The user can connect sucessfuly with wallet but also can reject
the sign message step. If the user rejects the login message signing and
closes the modal, they should get back to the initial state of the not
connected account.
The wagmi returns the connector object even if we call `disconnect`
function. In that case the connector has basic information like: id,
name, type and uuid and the status is set to `connected`. So here we
need to make sure the `getAccounts` and `getBitcoinAddress` functions
exist in the connector object.
Base automatically changed from ledger-live-new-api-updates to ledger-live-updates October 31, 2024 16:31
Copy link
Member

@nkuba nkuba left a comment

Choose a reason for hiding this comment

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

I tested the scenario I executed when the error occurred. It worked fine with this fix.

@r-czajkowski r-czajkowski marked this pull request as ready for review October 31, 2024 17:27
Copy link

netlify bot commented Oct 31, 2024

Deploy Preview for acre-dapp-testnet ready!

Name Link
🔨 Latest commit b473827
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp-testnet/deploys/6723bde9b6c4ce000808223c
😎 Deploy Preview https://deploy-preview-797--acre-dapp-testnet.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.

@nkuba nkuba merged commit 8adb0a0 into ledger-live-updates Nov 4, 2024
24 checks passed
@nkuba nkuba deleted the ledger-live-fix-connection-errors branch November 4, 2024 11:08
nkuba added a commit that referenced this pull request Nov 6, 2024
This is an integration PR that adds the necessary changes for the dapp
to run on Ledger Live.

Refs: #730 #742 #763 #759, #760, #797, #780,
thesis/orangekit#143,
thesis/orangekit#144

### Important note
Changes can only be tested in a Ledger Live app built from source. See
the [Ledger Live repo](https://github.com/LedgerHQ/ledger-live), how to
build from source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants