Skip to content

Commit

Permalink
fix share link in discover (#5324) (#5329)
Browse files Browse the repository at this point in the history
(cherry picked from commit e1db842)

Signed-off-by: abbyhu2000 <[email protected]>
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: Josh Romero <[email protected]>
  • Loading branch information
3 people authored Oct 20, 2023
1 parent 77b9c2d commit 0e4b9f4
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -35,6 +36,8 @@ export const getTopNavLinks = (
toastNotifications,
chrome,
store,
data: { query },
osdUrlStateStorage,
} = services;

const newSearch = {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 0e4b9f4

Please sign in to comment.