From f8b1bfac363a40f45439462ba8774098f60effbe Mon Sep 17 00:00:00 2001 From: Lunar Starstrum Date: Mon, 27 Jan 2025 05:01:11 -0600 Subject: [PATCH] Fix cases that don't have 25 options --- .../Moments/Pagination/PaginationDefaultComponentCreator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Interactivity/Moments/Pagination/PaginationDefaultComponentCreator.cs b/src/Interactivity/Moments/Pagination/PaginationDefaultComponentCreator.cs index 94fceba..e3b1287 100644 --- a/src/Interactivity/Moments/Pagination/PaginationDefaultComponentCreator.cs +++ b/src/Interactivity/Moments/Pagination/PaginationDefaultComponentCreator.cs @@ -83,7 +83,7 @@ private static int CalculatePageCount(int startingIndex, int totalPageCount) if (startingIndex == 0) { // Return 24 so that the "Next Section" button is added. - return totalPageCount > 25 ? 24 : 25; + return totalPageCount > 25 ? 24 : Math.Min(24, totalPageCount); } // Return 23 so that the "Previous Section" and "Next Section" buttons are added.