Fix flashy pp

This commit is contained in:
Liam 2022-10-20 18:20:21 +01:00
parent 3820358dfd
commit 923318af86

@ -6,6 +6,7 @@ import Utils from "../utils/utils";
export default class ScoreStats extends Component { export default class ScoreStats extends Component {
constructor(params) { constructor(params) {
super(params); super(params);
this.lastKnownPP = undefined;
} }
/** /**
@ -20,11 +21,14 @@ export default class ScoreStats extends Component {
render() { render() {
const data = this.props.data; const data = this.props.data;
const currentPP = Utils.calculatePP( let currentPP = Utils.calculatePP(
data.mapStarCount, data.mapStarCount,
data.percentage.replace("%", ""), data.percentage.replace("%", ""),
data.websiteType data.websiteType
); );
if (this.lastKnownPP === undefined || this.lastKnownPP < currentPP) {
currentPP = this.lastKnownPP;
}
return ( return (
<div className={styles.scoreStats}> <div className={styles.scoreStats}>