1
0
mirror of synced 2024-11-28 00:20:53 +01:00
This commit is contained in:
shiibe 2024-06-09 23:12:03 -04:00
parent ed8640c23f
commit e89566b61b
2 changed files with 7 additions and 16 deletions

View File

@ -54,7 +54,7 @@
<MudTh>@Localizer["Rank"]</MudTh>
</HeaderContent>
<RowTemplate>
@if ( @context.Rank > 0 && @context.BestScore > 0)
@if (@context.Rank > 0 && @context.BestScore > 0)
{
<MudTd>@context.Rank</MudTd>
<MudTd>

View File

@ -62,24 +62,15 @@ public partial class SongLeaderboardCard
// set TotalPages
TotalPages = response.TotalPages;
if (response.UserScore != null)
{
// if baid isn't already in the LeaderboardScores, add it
if (LeaderboardScores.All(x => x.Baid != response.UserScore.Baid))
if (response.UserScore != null
&& LeaderboardScores.All(x => x.Baid != response.UserScore.Baid)
&& (LeaderboardScores.Count == 0 || response.UserScore.Rank >= LeaderboardScores[0].Rank))
{
LeaderboardScores.Add(new SongLeaderboard()); // Add an empty row
LeaderboardScores.Add(response.UserScore);
}
}
TotalRows = LeaderboardScores.Count;
// log the LeaderboardScores
foreach (var score in LeaderboardScores)
{
Console.WriteLine(score.Rank + " " + score.Baid + " " + score.UserName + " " + score.BestScore + " " + score.BestRate + " " + score.BestCrown + " " + score.BestScoreRank);
}
isLoading = false;
}