diff --git a/public/assets/my.js b/public/assets/my.js
index 899dede..b7e594d 100644
--- a/public/assets/my.js
+++ b/public/assets/my.js
@@ -1425,6 +1425,11 @@
+ (copied ? ' is copied' : '') + '. On the faucet, choose Polygon Amoy, paste your address, and request POL. Then come back and buy.';
IAP.status('Faucet opened in a new tab. Choose Polygon Amoy, paste your address, and request test POL.', 'ok');
}));
+ if ($('wcDisconnect')) $('wcDisconnect').addEventListener('click', busy($('wcDisconnect'), async () => {
+ try { await IAPWallet.disconnect(); } catch (e) {}
+ $('wcDisconnectInfo').textContent = 'Disconnected. Tap Connect or Get test POL to pick a wallet again.';
+ IAP.status('Wallet disconnected. You can connect a different wallet now.', 'ok');
+ }));
$('activateBtn').addEventListener('click', busy($('activateBtn'), async () => {
const me = await (await fetch('/api/me')).json();
IAP.status('Confirm the free activation in your wallet…');
diff --git a/public/assets/wallet.js b/public/assets/wallet.js
index 03dddeb..f93e2ff 100644
--- a/public/assets/wallet.js
+++ b/public/assets/wallet.js
@@ -192,5 +192,12 @@ window.IAPWallet = (function () {
const hash = await sendTx(data, null);
return { hash, receipt: await waitTx(hash) };
}
- return { connect, signIn, buy, activate, waitTx };
+ // Drop the WalletConnect session + any stuck pending request, and forget the
+ // chosen provider so the next connect re-offers the wallet picker.
+ async function disconnect() {
+ try { if (wcProvider && wcProvider.disconnect) await wcProvider.disconnect(); } catch (e) {}
+ wcProvider = null; CHOSEN = null; wcSdkPromise = null;
+ try { Object.keys(localStorage).forEach(k => { if (/^wc@2|walletconnect|w3m|wcm_/i.test(k)) localStorage.removeItem(k); }); } catch (e) {}
+ }
+ return { connect, signIn, buy, activate, waitTx, disconnect };
})();
diff --git a/public/index.html b/public/index.html
index 6f96108..7918f16 100644
--- a/public/index.html
+++ b/public/index.html
@@ -439,7 +439,7 @@
-
+