Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fixed entry proportion calculation

Blue Mouse1b794f60274a
diff --git a/app/pages/Project/View/Panels.tsx b/app/pages/Project/View/Panels.tsx
index aeca0b435..f9f4398d9 100644
--- a/app/pages/Project/View/Panels.tsx
+++ b/app/pages/Project/View/Panels.tsx
@@ -855,8 +855,8 @@ const Panel = ({
}: IPanel): JSX.Element => {
const [page, setPage] = useState(0)
const currentIndex = page * ENTRIES_PER_PANEL
- const total = _size(data)
- const totalPages = _ceil(total / ENTRIES_PER_PANEL)
+ const total = useMemo(() => _reduce(data, (prev, curr) => prev + curr.count, 0), [data])
+ const totalPages = _ceil(_size(data) / ENTRIES_PER_PANEL)
const entries = useMemo(() => _orderBy(data, 'count', 'desc'), [data])
const entriesToDisplay = _slice(entries, currentIndex, currentIndex + ENTRIES_PER_PANEL)
const [activeFragment, setActiveFragment] = useState(0)