Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 936b01a

Browse files
committed
Fix Leaderboard pagination
- Enable AI matches
1 parent def07d1 commit 936b01a

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

src/app/components/Leaderboard/index.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,14 @@ export class Leaderboard extends React.Component<
3636
isSearching: false,
3737
nextFetchIndex: 1,
3838
offset: 0,
39-
pageSize: Math.floor((window.innerHeight * 0.7) / 100),
39+
pageSize: 10,
4040
pattern: '',
4141
};
4242
}
4343

4444
public componentWillMount(): void {
4545
this.props.clearLeaderboard();
46-
const noOfElems = Math.floor((window.innerHeight * 0.7) / 100);
47-
this.props.getLeaderboard(this.state.nextFetchIndex, noOfElems);
46+
this.props.getLeaderboard(this.state.nextFetchIndex, 10);
4847
this.props.getTimer();
4948
}
5049

src/app/components/SubmitBar/RunOptions.tsx

+13-13
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ export class RunOptions extends React.Component<
4949

5050
const maps = this.props.maps || hardCodedMap;
5151

52-
// const hardCodedAiIds: number[] = [1];
52+
const hardCodedAiIds: number[] = [1];
5353

54-
// @ts-ignore
55-
// const aiIds = hardCodedAiIds;
54+
@ts-ignore
55+
const aiIds = hardCodedAiIds;
5656

5757
const matchOptions = [
5858
{
@@ -63,16 +63,16 @@ export class RunOptions extends React.Component<
6363
},
6464
];
6565

66-
// if (aiIds) {
67-
// aiIds.map((aiId) => {
68-
// matchOptions.push({
69-
// aiId,
70-
// icon: <FontAwesomeIcon icon={faRobot} />,
71-
// name: `AI ${aiId} Match`,
72-
// type: SubmissionActions.Type.AI_MATCH,
73-
// });
74-
// });
75-
// }
66+
if (aiIds) {
67+
aiIds.map((aiId) => {
68+
matchOptions.push({
69+
aiId,
70+
icon: <FontAwesomeIcon icon={faRobot} />,
71+
name: `AI ${aiId} Match`,
72+
type: SubmissionActions.Type.AI_MATCH,
73+
});
74+
});
75+
}
7676

7777
const mapOptions = (
7878
<div className={classnames(styles['dropdown-submenu'])}>

0 commit comments

Comments
 (0)