From 691fbbe576cd1bf8336912ea06f2ff14d53b95aa Mon Sep 17 00:00:00 2001 From: Lucas Bordeau Date: Mon, 23 Dec 2024 14:24:15 +0100 Subject: [PATCH] Fix show page navigation bugs (#9199) Fixes total count bug that was -1 the total count Fixes a bug when trying to go from first to last or the other way around Fixes a React array key bug Follow-up issue (non critical) : https://github.com/twentyhq/twenty/issues/9197 --- .../RecordShowActionMenuButtons.tsx | 5 +- .../hooks/useRecordShowPagePagination.ts | 70 +++++++++++++------ 2 files changed, 53 insertions(+), 22 deletions(-) diff --git a/packages/twenty-front/src/modules/action-menu/components/RecordShowActionMenuButtons.tsx b/packages/twenty-front/src/modules/action-menu/components/RecordShowActionMenuButtons.tsx index 5a95f2c1fe27..0979be7b8c84 100644 --- a/packages/twenty-front/src/modules/action-menu/components/RecordShowActionMenuButtons.tsx +++ b/packages/twenty-front/src/modules/action-menu/components/RecordShowActionMenuButtons.tsx @@ -15,10 +15,10 @@ export const RecordShowActionMenuButtons = () => { return ( <> {!isMobile && - pinnedEntries.map((entry, index) => + pinnedEntries.map((entry) => entry.shortLabel ? (