public async Task LoadMoreData() { var ids = QueryResult.Result.Skip(Results?.Count ?? 0).Take(10).ToList(); if (IsFetching || ids.Count == 0) { return; } IsFetching = true; var getResult = await tradeSearchService.GetResults(QueryResult.Id, ids); IsFetching = false; if (getResult.Result.Any()) { Results.AddRange(getResult.Result.Select(result => new PriceItem(result) { ImageUrl = new Uri( languageProvider.Language.PoeCdnBaseUrl, staticDataService.GetImage(result.Listing.Price.Currency) ).AbsoluteUri, })); } UpdateCountString(); }
public async Task LoadMoreData() { if (IsFetching) { return; } try { var ids = QueryResult.Result.Skip(Results?.Count ?? 0).Take(10).ToList(); if (ids.Count == 0) { return; } IsFetching = true; var result = await tradeSearchService.GetResults(QueryResult.Id, ids, GetModifierFilters()); IsFetching = false; if (result != null && result.Any()) { Results.AddRange(result.Select(x => new PriceItem(x) { ImageUrl = new Uri($"{gameLanguageProvider.Language.PoeCdnBaseUrl}{itemStaticDataProvider.GetImage(x.Price.Currency)}").AbsoluteUri, })); } UpdateCountString(); } catch (Exception e) { logger.LogError(e, "Error loading more data"); } }