1
This commit is contained in:
@@ -3218,6 +3218,13 @@ fn list_puzzle_leaderboard_entries(
|
||||
.take(limit)
|
||||
.enumerate()
|
||||
.map(|(index, row)| PuzzleLeaderboardEntry {
|
||||
visible_tags: ctx
|
||||
.db
|
||||
.user_account()
|
||||
.user_id()
|
||||
.find(&row.user_id)
|
||||
.map(|account| visible_runtime_profile_user_tags(&account.user_tags))
|
||||
.unwrap_or_default(),
|
||||
rank: index as u32 + 1,
|
||||
nickname: row.nickname,
|
||||
elapsed_ms: row.best_elapsed_ms,
|
||||
@@ -3483,12 +3490,14 @@ mod tests {
|
||||
rank: 0,
|
||||
nickname: "玩家 B".to_string(),
|
||||
elapsed_ms: 5200,
|
||||
visible_tags: Vec::new(),
|
||||
is_current_player: false,
|
||||
},
|
||||
PuzzleLeaderboardEntry {
|
||||
rank: 0,
|
||||
nickname: "玩家 A".to_string(),
|
||||
elapsed_ms: 3100,
|
||||
visible_tags: Vec::new(),
|
||||
is_current_player: true,
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user