-
Notifications
You must be signed in to change notification settings - Fork 411
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: multipl session disconnects throwing #2655
Conversation
Branch preview✅ Deploy successful! https://fix_multiple_disconnection--walletweb.review-wallet-web.5afe.dev |
const isUnsupportedChain = !currentEip155ChainIds.includes(newEip155ChainId) | ||
const isNewSessionSafe = !currentEip155Accounts.includes(newEip155Account) | ||
|
||
// Switching to unsupported chain | ||
if (hasNewChainId) { | ||
if (isUnsupportedChain) { | ||
return this.disconnectSession(session) | ||
} | ||
|
||
// Add new account to the session namespace | ||
if (hasNewAccount) { | ||
// Add new Safe to the session namespace | ||
if (isNewSessionSafe) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These renames somehow didn't merge correctly before.
ESLint Summary View Full Report
Report generated by eslint-plus-action |
Coverage report❌ An unexpected error occurred. For more details, check console
Test suite run failedFailed tests: 2/1010. Failed suites: 4/141.
Report generated by 🧪jest coverage report action from ab82d11 |
What it solves
Resolves multiple session disconnects throwing
How this PR fixes it
Session updated are now handled one after each other.
How to test it
Connect two DApps that support chain A but not chain B. Switch from chain A to chain B and observe no WC-related error.
Checklist