From 6c40a8e487ede1eda29a5475a3a64802082d3b33 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sat, 28 Jan 2023 02:15:13 +0100 Subject: [PATCH] Browser History: Fix chat id in URL not clearing (#2334) --- src/hooks/useHistoryBack.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useHistoryBack.ts b/src/hooks/useHistoryBack.ts index f28f67021..bbbcb58cb 100644 --- a/src/hooks/useHistoryBack.ts +++ b/src/hooks/useHistoryBack.ts @@ -6,7 +6,7 @@ import { IS_IOS } from '../util/environment'; import { getActions } from '../lib/teact/teactn'; export const LOCATION_HASH = window.location.hash; -const PATH_BASE = `${window.location.pathname}${window.location.search}`; +const PATH_BASE = window.location.pathname; // Carefully selected by swiping and observing visual changes // TODO: may be different on other devices such as iPad, maybe take dpi into account? const SAFARI_EDGE_BACK_GESTURE_LIMIT = 300; @@ -119,7 +119,7 @@ function resetHistory() { onBack: () => window.history.back(), }]; - window.history.replaceState({ index: 0, historyUniqueSessionId }, PATH_BASE); + window.history.replaceState({ index: 0, historyUniqueSessionId }, '', PATH_BASE); } resetHistory();