|
|
@ -36,19 +36,23 @@ export const SearchReducer = (state: SearchState = SearchingInitialState, action |
|
|
|
count: 0 |
|
|
|
count: 0 |
|
|
|
} |
|
|
|
} |
|
|
|
case 'UPDATE_COUNT': |
|
|
|
case 'UPDATE_COUNT': |
|
|
|
const findFile = state.searchResults.find(file => file.filename === action.payload.file) |
|
|
|
if (state.searchResults) { |
|
|
|
let count = 0 |
|
|
|
const findFile = state.searchResults.find(file => file.filename === action.payload.file) |
|
|
|
if (findFile) { |
|
|
|
let count = 0 |
|
|
|
findFile.count = action.payload.count |
|
|
|
if (findFile) { |
|
|
|
} |
|
|
|
findFile.count = action.payload.count |
|
|
|
state.searchResults.forEach(file => { |
|
|
|
|
|
|
|
if (file.count) { |
|
|
|
|
|
|
|
count += file.count |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
state.searchResults.forEach(file => { |
|
|
|
return { |
|
|
|
if (file.count) { |
|
|
|
...state, |
|
|
|
count += file.count |
|
|
|
count: count |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
...state, |
|
|
|
|
|
|
|
count: count |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return state |
|
|
|
} |
|
|
|
} |
|
|
|
case 'TOGGLE_CASE_SENSITIVE': |
|
|
|
case 'TOGGLE_CASE_SENSITIVE': |
|
|
|
return { |
|
|
|
return { |
|
|
|