Skip to content

Commit

Permalink
fix s3 persistence load issue where it created two challengers
Browse files Browse the repository at this point in the history
  • Loading branch information
eviltester committed Mar 9, 2024
1 parent 5f25155 commit 327e20f
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import uk.co.compendiumdev.challenge.ChallengerState;
import uk.co.compendiumdev.challenge.challengers.Challengers;
import uk.co.compendiumdev.thingifier.api.ermodelconversion.JsonPopulator;
import uk.co.compendiumdev.thingifier.core.EntityRelModel;
import uk.co.compendiumdev.thingifier.core.domain.instances.ERInstanceData;

public class PersistenceLayer {
Expand All @@ -29,8 +28,7 @@ public PersistenceResponse tryToLoadChallenger(final Challengers challengers,
final PersistenceResponse response = loadChallengerStatus(xChallengerGuid);

if(response.isSuccess()){
ChallengerAuthData challenger = challengers.createNewChallenger();
challenger.fromData(response.getAuthData(), challengers.getDefinedChallenges());
ChallengerAuthData challenger = new ChallengerAuthData(challengers.getDefinedChallenges()).fromData(response.getAuthData(), challengers.getDefinedChallenges());
if(xChallengerGuid.equals(Challengers.SINGLE_PLAYER_GUID)){
challenger.setXChallengerGUID(xChallengerGuid);
}
Expand Down

0 comments on commit 327e20f

Please sign in to comment.