From 4f376a9ab6eb455709ef437501bb29c6e31fbb78 Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Fri, 16 Aug 2024 17:42:53 -0400 Subject: [PATCH] fix redirect state error --- frontend/public/404.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/public/404.html b/frontend/public/404.html index 8b5f35c..ce6ff0a 100644 --- a/frontend/public/404.html +++ b/frontend/public/404.html @@ -7,7 +7,13 @@ console.debug("With state:", history.state); const { origin, pathname, search, hash } = location; sessionStorage.redirectPath = pathname + search + hash; - sessionStorage.redirectState = JSON.stringify(history.state); + try { + // remove entries that could exceed storage limit + delete history.state.usr.results; + sessionStorage.redirectState = JSON.stringify(history.state); + } catch (error) { + console.error(error); + } location = "/";