diff --git a/lib/flop_phoenix/pagination.ex b/lib/flop_phoenix/pagination.ex index 186b687..c750cfd 100644 --- a/lib/flop_phoenix/pagination.ex +++ b/lib/flop_phoenix/pagination.ex @@ -59,15 +59,15 @@ defmodule Flop.Phoenix.Pagination do cond do max_pages >= total_pages -> - 1..total_pages + 1..total_pages//1 current_page + additional > total_pages -> - (total_pages - max_pages + 1)..total_pages + (total_pages - max_pages + 1)..total_pages//1 true -> first = max(current_page - additional + 1, 1) last = min(first + max_pages - 1, total_pages) - first..last + first..last//1 end end