Skip to content

Commit 17f6970

Browse files
committed
[Discover Tabs] Fix URL history stack
1 parent 96a2dc8 commit 17f6970

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/platform/plugins/shared/discover/public/application/main/state_management/tabs_storage_manager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ export const createTabsStorageManager = ({
155155
const nextState: TabsUrlState = {
156156
tabId: selectedTabId,
157157
};
158-
await urlStateStorage.set(TABS_STATE_URL_KEY, nextState);
158+
const previousState = getTabsStateFromURL();
159+
const shouldReplace = previousState?.tabId === NEW_TAB_ID;
160+
await urlStateStorage.set(TABS_STATE_URL_KEY, nextState, { replace: shouldReplace });
159161
};
160162

161163
const toTabStateInStorage = (

0 commit comments

Comments
 (0)