private async Task SetUserContent() { MainPage.CurrentUser = await WakaTimeRepo.GetCurrentUser(); if (MainPage.CurrentUser != null) { masterPage.gridUser.IsVisible = true; masterPage.gridUser.BindingContext = MainPage.CurrentUser; } Leaders leaders = await WakaTimeRepo.GetLeaders(); MainPage.CurrentLeader = leaders.CurrentUser; }
public async Task Cache(uint maxPage) { for (uint i = 1; i <= maxPage; i++) { if (this.leaders.ContainsKey(i)) { continue; } Leaders leaders = await WakaTimeRepo.GetLeaders(i); // Create thread to set the cache, prevent stuttering this.AddPageToCache(i, leaders); } }
internal async Task <Leaders> GetPage(uint currentPage) { if (this.leaders.ContainsKey(currentPage)) { this.leaders.TryGetValue(currentPage, out Leaders value); return(value); } Leaders leaders = await WakaTimeRepo.GetLeaders(currentPage); // Create thread to set the cache, prevent stuttering this.AddPageToCache(currentPage, leaders); return(leaders); }