Skip to content

Commit

Permalink
Slight tweak to page size options
Browse files Browse the repository at this point in the history
  • Loading branch information
codemonkey85 committed Nov 22, 2024
1 parent 7a91346 commit d2ceec4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
@bind-Value="PageSize"
@bind-Value:after="OnPageSizeChange"
Label="Items per page">
<MudSelectItem Value="10">10</MudSelectItem>
<MudSelectItem Value="20">20</MudSelectItem>
<MudSelectItem Value="50">50</MudSelectItem>
@foreach (var pageSize in PagesSizes)
{
<MudSelectItem Value="pageSize">
@pageSize
</MudSelectItem>
}
</MudSelect>

<div class="overflow-scroll"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public partial class MysteryGiftDatabaseTab
private List<MysteryGift> PaginatedItems = [];
private int CurrentPage = 1;
private int PageSize = 20; // Number of items per page
private readonly int[] PagesSizes = [10, 20, 50, 100];

private int TotalPages => (int)Math.Ceiling((double)MysteryGiftsList.Count / PageSize);

Expand Down Expand Up @@ -77,7 +78,7 @@ private async Task OnClickCopy(MysteryGift gift)
var temp = gift.ConvertToPKM(saveFile);
var pokemon = temp.Clone();

if (temp.GetType() != saveFile.PKMType)
if (temp.GetType() != saveFile.PKMType)
{
pokemon = EntityConverter.ConvertToType(temp, saveFile.PKMType, out var c);

Expand Down

0 comments on commit d2ceec4

Please sign in to comment.