This repository was archived by the owner on Jan 11, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed
Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 44
55// @flow
66
7- import { getSource , getActiveSearch , getPaneCollapse } from "../selectors" ;
7+ import {
8+ getActiveSearch ,
9+ getPaneCollapse ,
10+ getQuickOpenEnabled ,
11+ getSource
12+ } from "../selectors" ;
813import { getProjectDirectoryRoot } from "../reducers/ui" ;
914import type { ThunkArgs , panelPositionType } from "./types" ;
1015import { getRawSourceURL } from "../utils/source" ;
@@ -39,6 +44,10 @@ export function setActiveSearch(activeSearch?: ActiveSearchType) {
3944 return ;
4045 }
4146
47+ if ( getQuickOpenEnabled ( getState ( ) ) ) {
48+ dispatch ( { type : "CLOSE_QUICK_OPEN" } ) ;
49+ }
50+
4251 dispatch ( {
4352 type : "TOGGLE_ACTIVE_SEARCH" ,
4453 value : activeSearch
Original file line number Diff line number Diff line change @@ -137,10 +137,10 @@ class SearchBar extends Component<Props, State> {
137137 } ;
138138
139139 closeSearch = ( e : SyntheticEvent < HTMLElement > ) => {
140- const { editor, searchOn } = this . props ;
140+ const { closeFileSearch , editor, searchOn } = this . props ;
141141 if ( editor && searchOn ) {
142142 this . clearSearch ( ) ;
143- this . props . closeFileSearch ( editor ) ;
143+ closeFileSearch ( editor ) ;
144144 e . stopPropagation ( ) ;
145145 e . preventDefault ( ) ;
146146 }
@@ -150,13 +150,13 @@ class SearchBar extends Component<Props, State> {
150150 toggleSearch = ( e : SyntheticKeyboardEvent < HTMLElement > ) => {
151151 e . stopPropagation ( ) ;
152152 e . preventDefault ( ) ;
153- const { editor } = this . props ;
153+ const { editor, searchOn , setActiveSearch } = this . props ;
154154
155- if ( ! this . props . searchOn ) {
156- this . props . setActiveSearch ( "file" ) ;
155+ if ( ! searchOn ) {
156+ setActiveSearch ( "file" ) ;
157157 }
158158
159- if ( this . props . searchOn && editor ) {
159+ if ( searchOn && editor ) {
160160 const query = editor . codeMirror . getSelection ( ) || this . state . query ;
161161
162162 if ( query !== "" ) {
Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ export class ProjectSearch extends Component<Props, State> {
125125 if ( this . isProjectSearchEnabled ( ) ) {
126126 return closeProjectSearch ( ) ;
127127 }
128+
128129 return setActiveSearch ( "project" ) ;
129130 } ;
130131
You can’t perform that action at this time.
0 commit comments