From 01312ec2866dff4e3dfa1b1fec61da3c4d53542e Mon Sep 17 00:00:00 2001 From: Neelesh Sharma <43935540+nodaddy@users.noreply.github.com> Date: Tue, 29 Aug 2023 20:22:47 +0530 Subject: [PATCH] fix: back button issue fixed for traces/logs explorer (#3448) Co-authored-by: Palash Gupta --- frontend/src/hooks/useUrlQueryData.ts | 2 +- frontend/src/providers/QueryBuilder.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/hooks/useUrlQueryData.ts b/frontend/src/hooks/useUrlQueryData.ts index 1a0e556afd..22f26da5e9 100644 --- a/frontend/src/hooks/useUrlQueryData.ts +++ b/frontend/src/hooks/useUrlQueryData.ts @@ -23,7 +23,7 @@ const useUrlQueryData = ( urlQuery.set(queryKey, newQuery); const generatedUrl = `${location.pathname}?${urlQuery.toString()}`; - history.push(generatedUrl); + history.replace(generatedUrl); }, [history, location, urlQuery, queryKey], ); diff --git a/frontend/src/providers/QueryBuilder.tsx b/frontend/src/providers/QueryBuilder.tsx index 41d9d8eec4..07bd7c5477 100644 --- a/frontend/src/providers/QueryBuilder.tsx +++ b/frontend/src/providers/QueryBuilder.tsx @@ -492,7 +492,7 @@ export function QueryBuilderProvider({ const generatedUrl = `${location.pathname}?${urlQuery}`; - history.push(generatedUrl); + history.replace(generatedUrl); }, [history, location.pathname, urlQuery], );