Avoid a blank overflow page when showing paginated cards (closes #171)
This commit is contained in:
parent
5280e48b09
commit
7fde54050a
@ -103,7 +103,7 @@ namespace PluralKit.Bot {
|
|||||||
var buffer = new List<T>();
|
var buffer = new List<T>();
|
||||||
await using var enumerator = items.GetAsyncEnumerator();
|
await using var enumerator = items.GetAsyncEnumerator();
|
||||||
|
|
||||||
var pageCount = (totalCount / itemsPerPage) + 1;
|
var pageCount = (int) Math.Ceiling(totalCount / (double) itemsPerPage);
|
||||||
async Task<DiscordEmbed> MakeEmbedForPage(int page)
|
async Task<DiscordEmbed> MakeEmbedForPage(int page)
|
||||||
{
|
{
|
||||||
var bufferedItemsNeeded = (page + 1) * itemsPerPage;
|
var bufferedItemsNeeded = (page + 1) * itemsPerPage;
|
||||||
|
Loading…
Reference in New Issue
Block a user