Skip to content

Commit

Permalink
fix: entry list count
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed May 31, 2024
1 parent b028137 commit 4e9f967
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/renderer/src/components/entry-column/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function EntryColumn() {
defaultItemHeight={320}
overscan={window.innerHeight}
rangeChanged={handleRangeChange}
totalCount={entriesIds?.length}
totalCount={entries.data?.pages?.[0].total}
endReached={() => entries.hasNextPage && entries.fetchNextPage()}
data={entries.data?.pages.flatMap((page) => page.data)}
itemContent={(_, entry) => {
Expand Down Expand Up @@ -143,16 +143,13 @@ const ListHeader: FC = () => {
const activeList = useFeedStore(useShallow((state) => state.activeList))
const [filterTab, setFilterTab] = useAtom(filterTabAtom)
const entries = useEntriesByTab()
const total = entries.data?.pages?.reduce(
(acc, page) => acc + (page.data?.length || 0),
0,
)

return (
<div className="mb-5 flex w-full items-center justify-between px-9">
<div>
<div className="text-lg font-bold">{activeList?.name}</div>
<div className="text-xs font-medium text-zinc-400">
{total}
{entries.data?.pages?.[0].total}
{" "}
Items
</div>
Expand Down Expand Up @@ -182,7 +179,7 @@ const ListContent = forwardRef<HTMLDivElement>((props, ref) => {
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0.01, y: -100 }}
className={cn(
"h-full px-2",
"px-2",
activeList?.view &&
gridMode.has(activeList.view) &&
"grid grid-cols-2 gap-2 md:grid-cols-3 lg:grid-cols-4",
Expand Down

0 comments on commit 4e9f967

Please sign in to comment.