Skip to content

Commit

Permalink
#469 - Show progress on overview
Browse files Browse the repository at this point in the history
  • Loading branch information
maraf committed Jun 14, 2023
1 parent faaa0c8 commit 80e8f71
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Money.Blazor.Host/Pages/Overview.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,17 @@ protected async void Reload()

protected async Task<PagingLoadStatus> LoadDataAsync()
{
await Interop.ScrollToTopAsync();
using (Loading.Start())
{
await Interop.ScrollToTopAsync();

List<OutcomeOverviewModel> models = await Queries.QueryAsync(CreateItemsQuery(PagingContext.CurrentPageIndex));
Items = models;
if (models.Count == 0)
return PagingLoadStatus.EmptyPage;
List<OutcomeOverviewModel> models = await Queries.QueryAsync(CreateItemsQuery(PagingContext.CurrentPageIndex));
Items = models;
if (models.Count == 0)
return PagingLoadStatus.EmptyPage;

return Items.Count == 10 ? PagingLoadStatus.HasNextPage : PagingLoadStatus.LastPage;
return Items.Count == 10 ? PagingLoadStatus.HasNextPage : PagingLoadStatus.LastPage;
}
}

protected virtual IQuery<List<OutcomeOverviewModel>> CreateItemsQuery(int pageIndex)
Expand Down

0 comments on commit 80e8f71

Please sign in to comment.