Skip to content

Commit

Permalink
fix nan progress
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkIntaqt committed Apr 28, 2024
1 parent d4e9918 commit 9360863
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/module/user/Match.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ export default class Match extends Component {
continue;
}

if (isNaN(challenge["new"]["points"] - challenge["old"]["points"])) {
continue
}

data.push(<div key={"challenge" + i} className={css["levelUp" + isNew]}>
<LazyLoadImage src={"https://lolcdn.darkintaqt.com/cdn/np-token/" + challenge["challengeId"] + "/" + strtolower(intToTier(challenge["new"]["tier"]))} alt="" effect="opacity" height={30} width={30} />
<p>+{beautifyNum(challenge["new"]["points"] - challenge["old"]["points"], true, 1000)}</p>
Expand Down Expand Up @@ -285,6 +289,8 @@ export default class Match extends Component {
next = c["thresholds"][tier]
}

if (isNaN(challenge["new"]["points"] - challenge["old"]["points"])) continue;

allChallenges.push(<ChallengeObject
key={parseInt(challenge["challengeId"])}
tier={tier}
Expand Down Expand Up @@ -340,7 +346,7 @@ export default class Match extends Component {
}

if (allChallenges.length === 0) {
allChallenges = <p style={{ color: "white", fontSize: ".8rem", padding: "5px", textAlign: "center" }}>Nothing to see here...</p>;
allChallenges = <p style={{ color: "white", fontSize: ".8rem", padding: "5px", textAlign: "center" }}>Nothing progressed :/</p>;
}

return <div className={css.match + " " + css["expanded-" + this.state.expand]} id={this.state.matchId}>
Expand Down

0 comments on commit 9360863

Please sign in to comment.