-
Notifications
You must be signed in to change notification settings - Fork 22
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: enhance modal session handling to reject on user cancellation #348
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Mohamed Arbani <[email protected]>
Thanks for getting this PR going :) I like this idea, but I think the kind of error handling you're proposing should probably be an opt-in parameter with a callback that can be passed in. Otherwise, I fear that it is possible to introduce a breaking change to existing implementations |
Signed-off-by: Mohamed Arbani <[email protected]>
Signed-off-by: Mohamed Arbani <[email protected]>
hey @MohamedArbani , thanks for the contribution! Just letting you know we're reviewing the updates :) |
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.
@MohamedArbani Thanks so much for your contribution
These have been tested to be working and are useful for UX. They make it possible to handle the case of closing a modal window without pairing. This prevents the openModal promise from hanging, which is otherwise rejected only after a pairing timeout.
Can you review the suggestions / questions and let me know what you think?
…ErrorOnReject for clarity Signed-off-by: Mohamed Arbani <[email protected]>
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.
looks good to me, thanks for the contribution!
@MohamedArbani the last thing stopping this from being merged and published is signing the commits - https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification without the test passing merging is blocked |
Description:
This PR enhances the
openModal
function to handle scenarios where the user dismisses the WalletConnect modal without completing the wallet connection process.Key changes include:
showErrorOnReject
:subscribeModal
.approval
promise if the modal is closed, throwing an error with a descriptive message (User rejected pairing
).This improvement ensures the app properly handles cases where users dismiss the modal, improving UX and error feedback.
Notes for reviewer:
The following logs and behaviors can be observed with this change:
User rejected pairing
.approval
process is cleanly resolved or rejected based on user actions.closeModal()
is called in all cases.No breaking changes introduced to existing workflows.
Checklist