diff --git a/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.tsx b/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.tsx index 134a5e7c06f4..29c19887412c 100644 --- a/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.tsx +++ b/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.tsx @@ -20,6 +20,7 @@ import { DiscoverState, setSavedSearchId } from '../../utils/state_management'; import { DOC_HIDE_TIME_COLUMN_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../../common'; import { getSortForSearchSource } from '../../view_components/utils/get_sort_for_search_source'; import { getRootBreadcrumbs } from '../../helpers/breadcrumbs'; +import { syncQueryStateWithUrl } from '../../../../../data/public'; export const getTopNavLinks = ( services: DiscoverViewServices, @@ -35,6 +36,8 @@ export const getTopNavLinks = ( toastNotifications, chrome, store, + data: { query }, + osdUrlStateStorage, } = services; const newSearch = { @@ -108,6 +111,9 @@ export const getTopNavLinks = ( // set App state to clean store!.dispatch({ type: setSavedSearchId.type, payload: id }); + // starts syncing `_g` portion of url with query services + syncQueryStateWithUrl(query, osdUrlStateStorage); + return { id }; } } catch (error) {