File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
client/src/components/search/redux Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -32,16 +32,16 @@ export const reducer = handleActions(
3232 isSearchDropdownEnabled :
3333 typeof payload === 'boolean' ? payload : ! state . isSearchDropdownEnabled
3434 } ) ,
35- [ types . toggleSearchFocused ] : ( state , { payload } ) => ( {
35+ [ types . toggleSearchFocused ] : ( state , { payload } ) => {
36+ const focussed = state . isSearchBarFocused ;
37+ return focussed === payload
38+ ? state
39+ : { ...state , isSearchBarFocused : payload } ;
40+ } ,
41+ [ types . updateSearchQuery ] : ( state , { payload } ) => ( {
3642 ...state ,
37- isSearchBarFocused : payload
38- } ) ,
39- [ types . updateSearchQuery ] : ( state , { payload } ) => {
40- return {
41- ...state ,
42- query : payload
43- } ;
44- }
43+ query : payload
44+ } )
4545 } ,
4646 initialState
4747) ;
You can’t perform that action at this time.
0 commit comments