Skip to content

Commit 3512117

Browse files
opensearch-trigger-bot[bot]github-actions[bot]abbyhu2000
authored
fix share link in discover (#5324) (#5330)
Fixes: #5323 (cherry picked from commit e1db842) Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
1 parent 48a6c5d commit 3512117

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/plugins/discover/public/application/components/top_nav/get_top_nav_links.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { DiscoverState, setSavedSearchId } from '../../utils/state_management';
2020
import { DOC_HIDE_TIME_COLUMN_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../../common';
2121
import { getSortForSearchSource } from '../../view_components/utils/get_sort_for_search_source';
2222
import { getRootBreadcrumbs } from '../../helpers/breadcrumbs';
23+
import { syncQueryStateWithUrl } from '../../../../../data/public';
2324

2425
export const getTopNavLinks = (
2526
services: DiscoverViewServices,
@@ -35,6 +36,8 @@ export const getTopNavLinks = (
3536
toastNotifications,
3637
chrome,
3738
store,
39+
data: { query },
40+
osdUrlStateStorage,
3841
} = services;
3942

4043
const newSearch = {
@@ -108,6 +111,9 @@ export const getTopNavLinks = (
108111
// set App state to clean
109112
store!.dispatch({ type: setSavedSearchId.type, payload: id });
110113

114+
// starts syncing `_g` portion of url with query services
115+
syncQueryStateWithUrl(query, osdUrlStateStorage);
116+
111117
return { id };
112118
}
113119
} catch (error) {

0 commit comments

Comments
 (0)