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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user