Disconnect wallet: clear all WC state + reload so the picker truly reappears
Clearing localStorage alone wasn't enough — WalletConnect keeps the last wallet and session in memory, so it auto-reconnected the same wallet. Broadened the storage purge and reload the page after disconnect, guaranteeing a clean pick. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+4
-2
@@ -1427,8 +1427,10 @@
|
||||
}));
|
||||
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');
|
||||
$('wcDisconnectInfo').textContent = 'Disconnected. Reloading so you can pick a different wallet…';
|
||||
IAP.status('Wallet disconnected. Reloading…', 'ok');
|
||||
// reload to drop any in-memory WalletConnect state so the picker reappears
|
||||
setTimeout(() => location.reload(), 700);
|
||||
}));
|
||||
$('activateBtn').addEventListener('click', busy($('activateBtn'), async () => {
|
||||
const me = await (await fetch('/api/me')).json();
|
||||
|
||||
Reference in New Issue
Block a user