Skip to content

Commit 023a191

Browse files
committed
Fix compile errors
Signed-off-by: Kotaro Inoue <[email protected]>
1 parent ad75e4e commit 023a191

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/contests/ContestApp.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default class ContestApp extends React.Component<ContestAppProps, Contest
4949

5050
this.state = {
5151
initialized: false,
52-
submitResults: [] as [number],
52+
submitResults: ([] as unknown) as [number],
5353
};
5454
}
5555

@@ -59,7 +59,7 @@ export default class ContestApp extends React.Component<ContestAppProps, Contest
5959

6060
public componentWillUnmount(): void {
6161
if (this.rankingRequestTimerId !== 0) {
62-
clearInterval(this.rankingRequestTimerId);
62+
window.clearInterval(this.rankingRequestTimerId);
6363
}
6464
}
6565

@@ -287,7 +287,7 @@ export default class ContestApp extends React.Component<ContestAppProps, Contest
287287
label: dataSet.label,
288288
correct: dataSet.correct,
289289
score: dataSet.score,
290-
solvedAt: dataSet.solved_at ? new Date(dataSet.solved_at) : null,
290+
solvedAt: dataSet.solved_at ? new Date(dataSet.solved_at) : undefined,
291291
wrongAnswers: dataSet.wrong_answers,
292292
})),
293293
})),
@@ -304,7 +304,7 @@ export default class ContestApp extends React.Component<ContestAppProps, Contest
304304
this.setState({ users });
305305

306306
if (!this.rankingRequestTimerId) {
307-
this.rankingRequestTimerId = setInterval(this.fetchRanking.bind(this), 60 * 1000);
307+
this.rankingRequestTimerId = window.setInterval(this.fetchRanking.bind(this), 60 * 1000);
308308
}
309309
}
310310

@@ -321,7 +321,7 @@ export default class ContestApp extends React.Component<ContestAppProps, Contest
321321

322322
if (now < time.startAt) {
323323
setTimeout(() => {
324-
alert("コンテストを開始します");
324+
alert('コンテストを開始します');
325325
location.reload();
326326
}, time.startAt.getTime() - now.getTime());
327327
}
@@ -398,12 +398,13 @@ export default class ContestApp extends React.Component<ContestAppProps, Contest
398398
exact={true}
399399
path="/contests/:contestId"
400400
render={(): JSX.Element => <ContestHome contest={this.state.contest} join={this.join.bind(this)} />}
401-
/>;
401+
/>
402+
;
402403
<Route
403404
exact={true}
404405
path="/contests/:contestId/problems/:problemId"
405406
render={(props: any): JSX.Element => {
406-
return !this.state.contest.problems ? null : (
407+
return !this.state.contest.problems ? undefined : (
407408
<Problem
408409
contest={this.state.contest}
409410
problem={this.state.contest.problems.find(
@@ -419,7 +420,7 @@ export default class ContestApp extends React.Component<ContestAppProps, Contest
419420
exact={true}
420421
path="/contests/:contestId/ranking"
421422
render={(): JSX.Element => {
422-
return !this.state.users ? null : <Ranking contest={this.state.contest} users={this.state.users} />;
423+
return !this.state.users ? undefined : <Ranking contest={this.state.contest} users={this.state.users} />;
423424
}}
424425
/>
425426
<Route

0 commit comments

Comments
 (0)