Skip to content

Commit

Permalink
actual hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed Apr 15, 2020
1 parent cf87efb commit 12c9c56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/plugins/data/public/ui/search_bar/create_search_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ export function createSearchBar({ core, storage, data }: StatefulSearchBarDeps)
const onQuerySubmitRef = useRef(props.onQuerySubmit);
const defaultQuery = {
query: '',
language: core.uiSettings.get('search:queryLanguage'),
language:
storage.get('kibana.userQueryLanguage') || core.uiSettings.get('search:queryLanguage'),
};
const [query, setQuery] = useState<Query>(props.query || defaultQuery);

Expand Down Expand Up @@ -161,7 +162,7 @@ export function createSearchBar({ core, storage, data }: StatefulSearchBarDeps)
setQuery,
savedQueryId: props.savedQueryId,
notifications: core.notifications,
uiSettings: core.uiSettings,
defaultLanguage: defaultQuery.language,
});

// Fire onQuerySubmit on query or timerange change
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/data/public/ui/search_bar/lib/use_saved_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ interface UseSavedQueriesProps {
queryService: DataPublicPluginStart['query'];
setQuery: Function;
notifications: CoreStart['notifications'];
uiSettings: CoreStart['uiSettings'];
savedQueryId?: string;
defaultLanguage: string;
}

interface UseSavedQueriesReturn {
Expand All @@ -41,7 +41,7 @@ interface UseSavedQueriesReturn {

export const useSavedQuery = (props: UseSavedQueriesProps): UseSavedQueriesReturn => {
// Handle saved queries
const defaultLanguage = props.uiSettings.get('search:queryLanguage');
const defaultLanguage = props.defaultLanguage;
const [savedQuery, setSavedQuery] = useState<SavedQuery | undefined>();

// Effect is used to convert a saved query id into an object
Expand Down

0 comments on commit 12c9c56

Please sign in to comment.