🪢 Unwrangling state vars for global search vs local
This commit is contained in:
@@ -44,7 +44,7 @@ const initialState = {
|
||||
extractedComicBookArchive: [],
|
||||
recentComics: [],
|
||||
wantedComics: [],
|
||||
librarySearchResults: [],
|
||||
libraryComics: [],
|
||||
librarySearchResultsFormatted: [],
|
||||
librarySearchResultCount: 0,
|
||||
libraryQueueResults: [],
|
||||
@@ -190,12 +190,13 @@ function fileOpsReducer(state = initialState, action) {
|
||||
case SS_SEARCH_RESULTS_FETCHED: {
|
||||
return {
|
||||
...state,
|
||||
librarySearchResults: action.data,
|
||||
libraryComics: action.data,
|
||||
SSCallInProgress: false,
|
||||
};
|
||||
}
|
||||
case SS_SEARCH_RESULTS_FETCHED_SPECIAL: {
|
||||
const foo = [];
|
||||
console.log(action.data.hits)
|
||||
if (!isUndefined(action.data.hits)) {
|
||||
map(action.data.hits.hits, ({ _source }) => {
|
||||
foo.push(_source);
|
||||
@@ -207,6 +208,19 @@ function fileOpsReducer(state = initialState, action) {
|
||||
SSCallInProgress: false,
|
||||
};
|
||||
}
|
||||
case WANTED_COMICS_FETCHED: {
|
||||
const foo = [];
|
||||
if (!isUndefined(action.data.hits)) {
|
||||
map(action.data.hits.hits, ({ _source }) => {
|
||||
foo.push(_source);
|
||||
});
|
||||
}
|
||||
return {
|
||||
...state,
|
||||
wantedComics: foo,
|
||||
SSCallInProgress: false,
|
||||
};
|
||||
}
|
||||
|
||||
case SS_SEARCH_FAILED: {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user