Skip to content

Conversation

agualis
Copy link

@agualis agualis commented Feb 20, 2025

Fixes #2232

Uses localStorage to know if there is an existing Wallet Connect connection after reloading the page.
If yes, it avoids creating a new Wallet Connect connector ({ ...config, showQrModal: false }) which was leading to broken connection (with Error: No matching key. history: <number> error.).

The bug could be reproduced in the linked issue or in the the default rainbowkit example (Running pnpm run dev and following the reproduction steps in the linked issue).

@agualis agualis requested a review from a team as a code owner February 20, 2025 17:26
Copy link

vercel bot commented Feb 20, 2025

@agualis is attempting to deploy a commit to the rainbowdotme Team on Vercel.

A member of the Team first needs to authorize it.

const storageKey = 'rk-WalletConnect-connected';

function isLocalStorageAvailable() {
return typeof localStorage !== 'undefined';
Copy link
Author

Choose a reason for hiding this comment

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

This check is needed to avoid problems when running this check in the RSC pass.

@pyyding
Copy link

pyyding commented Apr 17, 2025

lgtm

Copy link

@0xGeegZ 0xGeegZ left a comment

Choose a reason for hiding this comment

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

LGTM

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.

[bug] WalletConnect connector creates multiple instances and gets unsynced from the app

3 participants