From 9d1e0f0253fd5bce4371a25348644dac775b9eca Mon Sep 17 00:00:00 2001 From: Simon <63975668+Simyon264@users.noreply.github.com> Date: Thu, 22 Aug 2024 01:18:58 +0200 Subject: [PATCH] Fix contributors page not loading correctly A '!' where there wasn't supposed to be one --- ReplayBrowser/Helpers/GitHubApiHelper.cs | 2 +- ReplayBrowser/Pages/Contributors.razor | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ReplayBrowser/Helpers/GitHubApiHelper.cs b/ReplayBrowser/Helpers/GitHubApiHelper.cs index 8efb58a..9c6c171 100644 --- a/ReplayBrowser/Helpers/GitHubApiHelper.cs +++ b/ReplayBrowser/Helpers/GitHubApiHelper.cs @@ -27,7 +27,7 @@ public GitHubApiHelper(IConfiguration configuration, IMemoryCache memoryCache) public async Task> GetContributors() { - if (!_memoryCache.TryGetValue("GitHubContributors", out List? contributors)) + if (_memoryCache.TryGetValue("GitHubContributors", out List? contributors)) return contributors!; try diff --git a/ReplayBrowser/Pages/Contributors.razor b/ReplayBrowser/Pages/Contributors.razor index 8829fed..f66e7c6 100644 --- a/ReplayBrowser/Pages/Contributors.razor +++ b/ReplayBrowser/Pages/Contributors.razor @@ -16,7 +16,7 @@

Contributors

- @if (_contributors.Count == 0) + @if (!_contributors.Any()) {

Error fetching contributors from the GitHub API

} @@ -31,8 +31,8 @@ @code { private List _contributors = new List(); - - protected async override Task OnInitializedAsync() + + protected override async Task OnInitializedAsync() { _contributors = await GitHubApiHelper.GetContributors(); }