Use strong typed comparison expressions

This commit is contained in:
Felix Hamme 2019-04-16 14:17:03 +02:00
parent 47b4c4602b
commit 303f774989
1 changed files with 4 additions and 4 deletions

View File

@ -56,7 +56,7 @@ class PrivateTournamentPage extends React.Component {
</Container> </Container>
<div className='stages pt-5'> <div className='stages pt-5'>
{playoffStages.map(stage => {playoffStages.map(stage =>
<Stage isSignedIn={isSignedIn} isOwner={username == ownerUsername} level={getLevelName(stage.level)} matches={stage.matches} key={stage.level}/>)} <Stage isSignedIn={isSignedIn} isOwner={username === ownerUsername} level={getLevelName(stage.level)} matches={stage.matches} key={stage.level}/>)}
</div> </div>
</div> </div>
); );
@ -368,12 +368,12 @@ function convertMatch(apiMatch) {
state: apiMatch.state state: apiMatch.state
}; };
if(apiMatch.match_scores.length == 2) { if(apiMatch.match_scores.length === 2) {
result.team1 = apiMatch.match_scores[0].team.name; result.team1 = apiMatch.match_scores[0].team.name;
result.scoreTeam1 = apiMatch.match_scores[0].points; result.scoreTeam1 = apiMatch.match_scores[0].points;
result.team2 = apiMatch.match_scores[1].team.name; result.team2 = apiMatch.match_scores[1].team.name;
result.scoreTeam2 = apiMatch.match_scores[1].points; result.scoreTeam2 = apiMatch.match_scores[1].points;
} else if(apiMatch.match_scores.length == 1) { } else if(apiMatch.match_scores.length === 1) {
result.team1 = apiMatch.match_scores[0].team.name; result.team1 = apiMatch.match_scores[0].team.name;
result.scoreTeam1 = apiMatch.match_scores[0].points; result.scoreTeam1 = apiMatch.match_scores[0].points;
result.team2 = 'TBD'; result.team2 = 'TBD';
@ -424,7 +424,7 @@ class Main extends React.Component {
const { status, tournament } = this.state; const { status, tournament } = this.state;
if (status == 200) { if (status === 200) {
return ( return (
<div> <div>
<Head> <Head>