Skip to content

Commit

Permalink
Fix contributors page not loading correctly
Browse files Browse the repository at this point in the history
A '!' where there wasn't supposed to be one
  • Loading branch information
Simyon264 committed Aug 21, 2024
1 parent c3588ce commit 9d1e0f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ReplayBrowser/Helpers/GitHubApiHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public GitHubApiHelper(IConfiguration configuration, IMemoryCache memoryCache)

public async Task<List<GitHubAccount>> GetContributors()
{
if (!_memoryCache.TryGetValue("GitHubContributors", out List<GitHubAccount>? contributors))
if (_memoryCache.TryGetValue("GitHubContributors", out List<GitHubAccount>? contributors))
return contributors!;

try
Expand Down
6 changes: 3 additions & 3 deletions ReplayBrowser/Pages/Contributors.razor
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<h3>Contributors</h3>

<div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: center; padding: 20px;">
@if (_contributors.Count == 0)
@if (!_contributors.Any())
{
<h4 style="color: red">Error fetching contributors from the GitHub API</h4>
}
Expand All @@ -31,8 +31,8 @@

@code {
private List<GitHubAccount> _contributors = new List<GitHubAccount>();
protected async override Task OnInitializedAsync()

protected override async Task OnInitializedAsync()
{
_contributors = await GitHubApiHelper.GetContributors();
}
Expand Down

0 comments on commit 9d1e0f0

Please sign in to comment.