-
Notifications
You must be signed in to change notification settings - Fork 464
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: session management when switching chains #2640
Conversation
Branch preview⏳ Deploying a preview site... |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
useEffect(() => { | ||
if (!walletConnect || isSafeConnected) return | ||
|
||
walletConnect.disconnectAllSessions().catch(setError) |
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.
What if a Safe is just being loaded? WC sessions live across page reloads unless disconnected.
Or the user went to the Welcome page temporarily.
I wouldn't disconnect anything per se, I would just stop accepting requests for a given Safe if you're in another Safe/outside of any Safe.
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.
We reference the safe
search param for this reason.
src/services/walletconnect/utils.ts
Outdated
}, | ||
}, | ||
}) | ||
} |
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.
Stylistically, I don't see this function as a util. I would keep it as a private method in the WalletConnectWallet class.
What it solves
Resolves unsupported sessions remaining connected
How this PR fixes it
How to test it
Screenshots
Checklist