Skip to content

Commit 28b16b1

Browse files
authored
Merge pull request #12588 from nanaya/more-quickplay-rank-display
Adjust quickplay rank display on profile page
2 parents 9474322 + d872c7c commit 28b16b1

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

app/Transformers/MatchmakingPoolTransformer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class MatchmakingPoolTransformer extends TransformerAbstract
1414
public function transform(MatchmakingPool $pool): array
1515
{
1616
return [
17+
'active' => $pool->active,
1718
'id' => $pool->getKey(),
1819
'name' => $pool->name,
1920
'ruleset_id' => $pool->ruleset_id,

resources/js/interfaces/matchmaking-pool-json.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import { RulesetId, RulesetVariantId } from './ruleset';
55

66
export default interface MatchmakingPoolJson {
7+
active: boolean;
78
id: number;
89
name: string;
910
ruleset_id: RulesetId;

resources/js/profile-page/matchmaking.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ interface Props {
1414
@observer
1515
export default class Matchmaking extends React.Component<Props> {
1616
render() {
17+
if (this.props.allStats.length === 0) {
18+
return null;
19+
}
1720
let highestRank: null | number = null;
1821
for (const stats of this.props.allStats) {
1922
const rank = stats.rank;
20-
if (rank != null) {
23+
// only show active stats for profile page
24+
if (stats.pool.active && rank != null) {
2125
if (highestRank == null) {
2226
highestRank = rank;
2327
} else if (rank < highestRank) {

0 commit comments

Comments
 (0)