diff --git a/public/assets/my.js b/public/assets/my.js index ff8e273..b6e5b4d 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -1429,11 +1429,12 @@ 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. 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); + // fire-and-forget: don't gate the reload on disconnect resolving (it can + // stall). The reload drops all in-memory wallet state and the picker returns. + IAPWallet.disconnect().catch(() => {}); + $('wcDisconnectInfo').textContent = 'Disconnecting — reloading so you can pick a different wallet…'; + IAP.status('Disconnecting — reloading…', 'ok'); + setTimeout(() => location.reload(), 900); })); $('activateBtn').addEventListener('click', busy($('activateBtn'), async () => { const me = await (await fetch('/api/me')).json(); diff --git a/public/assets/wallet.js b/public/assets/wallet.js index 3575b0a..48ada81 100644 --- a/public/assets/wallet.js +++ b/public/assets/wallet.js @@ -186,7 +186,9 @@ window.IAPWallet = (function () { } async function disconnect() { - try { if (modal && modal.disconnect) await modal.disconnect(); } catch (e) {} + // AppKit's disconnect can hang on the WalletConnect relay (esp. mobile) — + // never block on it, so the UI can't get stuck "disconnecting". + try { if (modal && modal.disconnect) await Promise.race([modal.disconnect(), new Promise(r => setTimeout(r, 1200))]); } catch (e) {} provider = null; try { Object.keys(localStorage).forEach(k => { if (/wc@2|walletconnect|w3m|wcm|reown|wagmi|appkit/i.test(k)) localStorage.removeItem(k); }); } catch (e) {} } diff --git a/public/my.html b/public/my.html index 1a58743..ffd3bc7 100644 --- a/public/my.html +++ b/public/my.html @@ -696,7 +696,7 @@ - +