Location
contexts/WalletContext.tsx:397-398 (disconnect)
Description
disconnect() calls localStorage.clear() and sessionStorage.clear() unconditionally, not scoped to the wallet-specific storage key. Confirmed via next-themes (a real package.json dependency, used in components/ThemeToggle.tsx) that this also wipes the user's persisted theme preference — an unrelated feature — every time they disconnect their wallet.
Why it matters
Disconnecting a wallet is a routine, frequent action; resetting the user's theme (and any other unrelated localStorage/sessionStorage state any future feature might add) every single time is a surprising, unintended side effect with a growing blast radius as more features start using storage.
Suggested fix
Remove only the specific wallet-session storage key(s) instead of calling a blanket clear().
Acceptance criteria
Location
contexts/WalletContext.tsx:397-398(disconnect)Description
disconnect()callslocalStorage.clear()andsessionStorage.clear()unconditionally, not scoped to the wallet-specific storage key. Confirmed vianext-themes(a realpackage.jsondependency, used incomponents/ThemeToggle.tsx) that this also wipes the user's persisted theme preference — an unrelated feature — every time they disconnect their wallet.Why it matters
Disconnecting a wallet is a routine, frequent action; resetting the user's theme (and any other unrelated localStorage/sessionStorage state any future feature might add) every single time is a surprising, unintended side effect with a growing blast radius as more features start using storage.
Suggested fix
Remove only the specific wallet-session storage key(s) instead of calling a blanket
clear().Acceptance criteria
disconnect()only removes wallet-specific storage entries