Fix flashy pp

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

View File

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