From 90e33a42b5d4eb03168ba1272dac7d037e0edfc2 Mon Sep 17 00:00:00 2001 From: martbost Date: Tue, 8 Sep 2026 08:56:10 -0500 Subject: [PATCH] WalletConnect: add redirect metadata (return to dApp after wallet approvals) Sets metadata.redirect so mobile wallets bounce the user back to /my after each approval instead of stranding them in the wallet app. Co-Authored-By: Claude Opus 4.8 --- public/assets/wallet.js | 4 +++- public/index.html | 2 +- public/my.html | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/assets/wallet.js b/public/assets/wallet.js index af34c8c..0299428 100644 --- a/public/assets/wallet.js +++ b/public/assets/wallet.js @@ -83,7 +83,9 @@ window.IAPWallet = (function () { projectId, optionalChains: [chainId], showQrModal: true, rpcMap: { [chainId]: c.rpc }, metadata: { name: c.siteName || 'InstantAdPay', description: c.tagline || 'Advertise and earn, paid on-chain.', - url: location.origin, icons: [location.origin + '/logo-icon.png'] } + url: location.origin, icons: [location.origin + '/logo-icon.png'], + // ask the wallet to bounce back to the dashboard after each approval + redirect: { native: '', universal: location.origin + '/my' } } }); } if (!wcProvider.session) await wcProvider.connect(); // QR on desktop, opens the wallet app on mobile diff --git a/public/index.html b/public/index.html index 1cc7dae..115e79c 100644 --- a/public/index.html +++ b/public/index.html @@ -439,7 +439,7 @@ - + diff --git a/public/my.html b/public/my.html index 80e4d04..242a854 100644 --- a/public/my.html +++ b/public/my.html @@ -690,7 +690,7 @@ - +