Skip to content

Commit

Permalink
chore: small fixes
Browse files Browse the repository at this point in the history
changes:
- fixed some inline variables
  • Loading branch information
BoBoBaSs84 committed Jun 30, 2024
1 parent b8c8c31 commit 10016d8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions src/BB84.SAU.Application/ViewModels/AchievementsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,20 @@ private async Task LoadAchievements()
{
AchievementsAreLoading = true;

IEnumerable<AchievementModel> achievements = await _steamWebService.GetAchievementsAsync(Model.Id, _steamSettings.ApiKey)
IEnumerable<AchievementModel> achievementsData = await _steamWebService.GetAchievementsAsync(Model.Id, _steamSettings.ApiKey)
.ConfigureAwait(true);

foreach (AchievementModel achievement in achievements)
foreach (AchievementModel achievementData in achievementsData)
{
(bool achieved, DateTime? unlockTime) = _steamApiService.GetAchievement(achievement.Id);
(bool achieved, DateTime? unlockTime) = _steamApiService.GetAchievement(achievementData.Id);

if (achieved)
{
achievement.Unlocked = achieved;
achievement.UnlockedTime = unlockTime;
achievementData.Unlocked = achieved;
achievementData.UnlockedTime = unlockTime;
}

Model.Achievements.Add(achievement);
Model.Achievements.Add(achievementData);
}
}
finally
Expand Down
10 changes: 5 additions & 5 deletions src/BB84.SAU.Application/ViewModels/GamesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,16 @@ private async Task LoadGames()
{
GamesAreLoading = true;

IEnumerable<GameModel> games = await _steamWebService.GetGamesAsync(_steamSettings.Id, _steamSettings.ApiKey)
IEnumerable<GameModel> gamesData = await _steamWebService.GetGamesAsync(_steamSettings.Id, _steamSettings.ApiKey)
.ConfigureAwait(true);

foreach (GameModel game in games)
foreach (GameModel gameData in gamesData)
{
GameDetailModel? gameDetail = await _steamWebService.GetGameDetailsAsync(game.Id)
GameDetailModel? gameDetailData = await _steamWebService.GetGameDetailsAsync(gameData.Id)
.ConfigureAwait(true);

if (gameDetail is not null)
Model.Games.Add(gameDetail);
if (gameDetailData is not null)
Model.Games.Add(gameDetailData);
}
}
finally
Expand Down
16 changes: 8 additions & 8 deletions src/BB84.SAU.Application/ViewModels/UserDataViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ private async Task LoadUserDataAsync()
{
IsUserDataLoading = true;

UserDataModel? loadedModel = await _steamWebService.GetUserDataAsync(_steamSettings.Id, _steamSettings.ApiKey)
UserDataModel? userData = await _steamWebService.GetUserDataAsync(_steamSettings.Id, _steamSettings.ApiKey)
.ConfigureAwait(true);

if (loadedModel is null)
if (userData is null)
return;

Model.Name = loadedModel.Name;
Model.ImageUrl = loadedModel.ImageUrl;
Model.ProfileUrl = loadedModel.ProfileUrl;
Model.Created = loadedModel.Created;
Model.LastLogOff = loadedModel.LastLogOff;
Model.LastUpdate = loadedModel.LastUpdate;
Model.Name = userData.Name;
Model.ImageUrl = userData.ImageUrl;
Model.ProfileUrl = userData.ProfileUrl;
Model.Created = userData.Created;
Model.LastLogOff = userData.LastLogOff;
Model.LastUpdate = userData.LastUpdate;

Image = CreateImageFromUri(new(Model.ImageUrl));
}
Expand Down

0 comments on commit 10016d8

Please sign in to comment.