Skip to content

feat: close wallet tab after request modal is closed#829

Merged
ganchoradkov merged 1 commit intomainfrom
feat/wallet-close-after-req
Mar 12, 2025
Merged

feat: close wallet tab after request modal is closed#829
ganchoradkov merged 1 commit intomainfrom
feat/wallet-close-after-req

Conversation

@ganchoradkov
Copy link
Member

@ganchoradkov ganchoradkov commented Feb 25, 2025

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

@vercel
Copy link

vercel bot commented Feb 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
decentralized-relay-wallet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 25, 2025 0:58am
react-wallet-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 25, 2025 0:58am
9 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-react-wagmi-example ⬜️ Ignored (Inspect) Feb 25, 2025 0:58am
appkit-solana ⬜️ Ignored (Inspect) Feb 25, 2025 0:58am
chain-abstraction-demo ⬜️ Ignored (Inspect) Visit Preview Feb 25, 2025 0:58am
decentralized-relay-app ⬜️ Ignored (Inspect) Visit Preview Feb 25, 2025 0:58am
malicious-dapp-verify-simulation ⬜️ Ignored (Inspect) Visit Preview Feb 25, 2025 0:58am
react-dapp-v2 ⬜️ Ignored (Inspect) Visit Preview Feb 25, 2025 0:58am
react-dapp-v2-cosmos-provider ⬜️ Ignored (Inspect) Visit Preview Feb 25, 2025 0:58am
react-dapp-v2-with-ethers ⬜️ Ignored (Inspect) Visit Preview Feb 25, 2025 0:58am
smart-sessions-demo ⬜️ Ignored (Inspect) Visit Preview Feb 25, 2025 0:58am

@cloudflare-workers-and-pages
Copy link

Deploying demo-ai-agents with  Cloudflare Pages  Cloudflare Pages

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

View logs

Copy link
Contributor

@arein arein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - but do you need to test it from:

  1. web mobile
  2. native mobile

as well?

@arein arein requested review from bkrem and Copilot March 7, 2025 04:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, () => {

@ganchoradkov ganchoradkov merged commit ee3caae into main Mar 12, 2025
15 checks passed
@ganchoradkov ganchoradkov deleted the feat/wallet-close-after-req branch March 12, 2025 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants