Prevent score in challenge history from being overwritten by a worse score

This commit is contained in:
Melledy
2023-10-26 23:32:22 -07:00
parent c25803e678
commit 598f097e99

View File

@@ -32,6 +32,10 @@ public class ChallengeHistory {
this.challengeId = challengeId;
}
public void setStars(int stars) {
this.stars = Math.max(this.stars, stars);
}
public Challenge toProto() {
var proto = Challenge.newInstance()
.setChallengeId(this.getChallengeId())