feat: close wallet tab after request modal is closed#829
Merged
ganchoradkov merged 1 commit intomainfrom Mar 12, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
9 Skipped Deployments
|
Deploying demo-ai-agents with
|
| Latest commit: |
01c21f4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b2e5053a.demo-ai-agents.pages.dev |
| Branch Preview URL: | https://feat-wallet-close-after-req.demo-ai-agents.pages.dev |
arein
approved these changes
Mar 7, 2025
Contributor
arein
left a comment
There was a problem hiding this comment.
LGTM - but do you need to test it from:
- web mobile
- native mobile
as well?
Contributor
There was a problem hiding this comment.
PR Overview
This PR implements a feature that automatically closes the wallet tab after the request modal is closed to reduce tab clutter when handling deeplink requests.
- Merged two conditional branches in the modal open logic into one to ensure consistent behavior when either uri or requestId is present.
- Extended the ModalStore.open function to accept an onClose callback that handles tab closure once the modal is dismissed.
Reviewed Changes
| File | Description |
|---|---|
| advanced/wallets/react-wallet-v2/src/pages/wc.tsx | Updated modal triggering logic to include an onClose callback that logs and closes the tab. |
| advanced/wallets/react-wallet-v2/src/store/ModalStore.ts | Updated ModalStore.open to support a callback on modal close and removed an unused import. |
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
advanced/wallets/react-wallet-v2/src/pages/wc.tsx:40
- [nitpick] Consider removing or replacing the console.log with a structured logging method for production readiness, and verify that window.close() operates correctly given browser restrictions.
console.log('Modal closed')
advanced/wallets/react-wallet-v2/src/store/ModalStore.ts:59
- [nitpick] Ensure that the subscription in ModalStore.open does not inadvertently trigger multiple calls to onClose if state updates rapidly, and confirm that unsubscribe is reliably called.
const unsubscribe = subscribe(state, () => {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The wallet now closes automatically after responding to a request from a deeplink. This removes tab clutter as apps open the wallet in a new new tab on every request
https://www.notion.so/walletconnect/Engineering-1405a07b0a424104b65d9df0c2e6648e?p=1a53a661771e8077bf2dc67e0f2020b2&pm=s