1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: errors during leaderboard generation

This commit is contained in:
Ferdinand Mütsch
2022-10-20 08:33:12 +02:00
parent b1d7f87095
commit efd6ba36e3
6 changed files with 27 additions and 20 deletions

View File

@@ -10,7 +10,7 @@ type LeaderboardViewModel struct {
User *models.User
By string
Key string
Items []*models.LeaderboardItem
Items []*models.LeaderboardItemRanked
TopKeys []string
UserLanguages map[string][]string
ApiKey string
@@ -29,7 +29,7 @@ func (s *LeaderboardViewModel) WithError(m string) *LeaderboardViewModel {
return s
}
func (s *LeaderboardViewModel) ColorModifier(item *models.LeaderboardItem, principal *models.User) string {
func (s *LeaderboardViewModel) ColorModifier(item *models.LeaderboardItemRanked, principal *models.User) string {
if principal != nil && item.UserID == principal.ID {
return "self"
}