From 7033c32ae9f646ad7b36c3b2bd5622c3f21994b4 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 10 Oct 2019 08:22:35 +0200 Subject: [PATCH] Prepare for TS 3.7 upgrade (#47683) (#47734) --- x-pack/legacy/plugins/code/model/search.ts | 2 +- x-pack/legacy/plugins/code/public/reducers/search.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/code/model/search.ts b/x-pack/legacy/plugins/code/model/search.ts index f9249f46c0994..04f99952d7c72 100644 --- a/x-pack/legacy/plugins/code/model/search.ts +++ b/x-pack/legacy/plugins/code/model/search.ts @@ -8,7 +8,7 @@ import { DetailSymbolInformation } from '@elastic/lsp-extension'; import { IRange } from 'monaco-editor'; import { DiffKind } from '../common/git_diff'; -import { Repository, SourceHit } from '../model'; +import { Repository } from '../model'; import { RepositoryUri } from './repository'; export interface Document { diff --git a/x-pack/legacy/plugins/code/public/reducers/search.ts b/x-pack/legacy/plugins/code/public/reducers/search.ts index 5092e611215b8..391f6ac76640e 100644 --- a/x-pack/legacy/plugins/code/public/reducers/search.ts +++ b/x-pack/legacy/plugins/code/public/reducers/search.ts @@ -93,7 +93,7 @@ export const search = handleActions( { [String(changeSearchScope)]: (state: SearchState, action: Action) => produce(state, draft => { - if (Object.values(SearchScope).includes(action.payload)) { + if (action.payload && Object.values(SearchScope).includes(action.payload)) { draft.scope = action.payload!; } else { draft.scope = SearchScope.DEFAULT;