Description
Refreshing the page disconnects the Freighter wallet, forcing users to re-approve the connection on every visit. The last connected wallet's public key should be cached and the connection silently re-established on mount where the user has previously granted permission.
Technical Context
src/hooks/useWallet.ts should call freighter.isConnected() on mount and, if true, skip the approval popup by calling freighter.getPublicKey() directly. The cached public key is stored in sessionStorage (not localStorage) to avoid persisting across closed browser tabs. src/context/WalletContext.tsx (new or existing) exposes connection state app-wide via a React context. src/components/wallet/WalletConnect.tsx reflects the cached state immediately without a loading flash.
Acceptance Criteria
Description
Refreshing the page disconnects the Freighter wallet, forcing users to re-approve the connection on every visit. The last connected wallet's public key should be cached and the connection silently re-established on mount where the user has previously granted permission.
Technical Context
src/hooks/useWallet.tsshould callfreighter.isConnected()on mount and, if true, skip the approval popup by callingfreighter.getPublicKey()directly. The cached public key is stored insessionStorage(notlocalStorage) to avoid persisting across closed browser tabs.src/context/WalletContext.tsx(new or existing) exposes connection state app-wide via a React context.src/components/wallet/WalletConnect.tsxreflects the cached state immediately without a loading flash.Acceptance Criteria
sessionStorageso the next session starts freshsessionStorageentry and renders the connect button