Fixed: Fix book index footer stats

Fixes #1405
Fixes #1407
This commit is contained in:
ta264
2021-12-23 21:41:43 +00:00
parent 8011112919
commit 472da10149
2 changed files with 23 additions and 37 deletions
@@ -6,16 +6,18 @@ import BookIndexFooter from './BookIndexFooter';
function createUnoptimizedSelector() {
return createSelector(
createClientSideCollectionSelector('authors', 'authorIndex'),
(authors) => {
return authors.items.map((s) => {
createClientSideCollectionSelector('books', 'bookIndex'),
(books) => {
return books.items.map((s) => {
const {
authorId,
monitored,
status,
statistics
} = s;
return {
authorId,
monitored,
status,
statistics
@@ -25,19 +27,19 @@ function createUnoptimizedSelector() {
);
}
function createAuthorSelector() {
function createBookSelector() {
return createDeepEqualSelector(
createUnoptimizedSelector(),
(author) => author
(book) => book
);
}
function createMapStateToProps() {
return createSelector(
createAuthorSelector(),
(author) => {
createBookSelector(),
(book) => {
return {
author
book
};
}
);