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

[core, react, vue]: Feature - Connect all previously connected wallets #1603

Merged
merged 9 commits into from
Mar 24, 2023

Conversation

Adamj1232
Copy link
Member

@Adamj1232 Adamj1232 commented Mar 23, 2023

Description

Adds option to reconnect all previously connected wallets as an option.

Wallets will be reconnected in the order they were previously held within the array.

A new format is introduced within the PR for local storage saving of the wallet labels with an array of strings being used instead of a string. This will be the case regardless if the dev elects usage of autoConnectAllPreviousWallet or autoConnectLastWallet

type ConnectModalOptions = {
  ...
  /** 
   * If set to true, all previously connected wallets will store in 
   * local storage. Then on init, onboard will try to reconnect to 
   * each wallet with no modals displayed
   */
  autoConnectAllPreviousWallet?: boolean
}

Checklist

  • Increment the version field in package.json of the package you have made changes in following semantic versioning and using alpha release tagging
  • Check the box that allows repo maintainers to update this PR
  • Test locally to make sure this feature/fix works
  • Run yarn check-all to confirm there are not any associated errors
  • Confirm this PR passes Circle CI checks
  • Add or update relevant information in the documentation

@vercel
Copy link

vercel bot commented Mar 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
web3-onboard-docs ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 24, 2023 at 3:36PM (UTC)

Copy link
Contributor

@lnbc1QWFyb24 lnbc1QWFyb24 left a comment

Choose a reason for hiding this comment

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

Just one question around checking the list lenght

Copy link
Contributor

@leightkt leightkt left a comment

Choose a reason for hiding this comment

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

When switching to this branch with a previously connected wallet in the demo project, I got this error:
Screenshot 2023-03-23 at 5 00 01 PM

I can only load the demo app after I clear my local storage and reload.

Once I refreshed the page- I was able to test and worked as expected- reconnecting all wallets I had connected.

@Adamj1232
Copy link
Member Author

When switching to this branch with a previously connected wallet in the demo project, I got this error: Screenshot 2023-03-23 at 5 00 01 PM

I can only load the demo app after I clear my local storage and reload.

Once I refreshed the page- I was able to test and worked as expected- reconnecting all wallets I had connected.

Ahh yep, forgot to add a try block to one area, should be fixed now for backwards compatibility throughout. Thanks for catching that!!

Copy link
Contributor

@leightkt leightkt left a comment

Choose a reason for hiding this comment

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

woot woot! g2g

@Adamj1232 Adamj1232 merged commit 494dd26 into develop Mar 24, 2023
@Adamj1232 Adamj1232 deleted the feature/connect_all_wallets branch March 24, 2023 16:54
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.

3 participants