Skip to content

Commit

Permalink
[#48] fix: search initial counts not showing correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
junglesub committed Feb 4, 2022
1 parent 33b7cbb commit 409247e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/hooks/useSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ function searchReducer(state, { type, payload }) {
const { search, lectures, page, pages, bookmarks, spikes } = payload;
return {
search,
searchResults: lectures.map((lecture) => new Lecture(lecture, bookmarks, spikes)),
searchResults: lectures.map((lecture) =>
new Lecture(lecture, bookmarks, spikes).updateCount(lecture.count),
),
searchLoading: false,
pagination: {
total: pages,
Expand Down

0 comments on commit 409247e

Please sign in to comment.