Open MohamedArbani opened 5 days ago
@MohamedArbani
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
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:
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