From e8d01b6a780b5bc1d00f8a81dff9d0c92ee4b3ea Mon Sep 17 00:00:00 2001 From: iajibose Date: Thu, 30 Jul 2026 12:19:04 +0100 Subject: [PATCH] Trim raw localStorage value before parsing wallet session Small first step toward #1082. Full try/catch error boundary around hydrate, clearing invalid stored sessions, and the regression test still need to be added in a follow-up. --- frontend/src/context/wallet-context.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/context/wallet-context.tsx b/frontend/src/context/wallet-context.tsx index 3538a7c9..43d9f4d9 100644 --- a/frontend/src/context/wallet-context.tsx +++ b/frontend/src/context/wallet-context.tsx @@ -142,7 +142,7 @@ function readStoredSession(): WalletSession | null { return null; } - const raw = window.localStorage.getItem(STORAGE_KEY); + const raw = window.localStorage.getItem(STORAGE_KEY)?.trim(); if (!raw) { return null; }