Commit b1bb2a10 authored by Jakob Moser's avatar Jakob Moser
Browse files

Fix token that was broken

Only the property "realm" was contained in the toString() JSON.
This is because the other properties are realized via getters, so when used with a class, they are actually fields of the prototype object and are not considered by JSON.stringify

In early versions, currentState was an object (and there was no class), so we didn't have this problem
parent 18cc6750
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -110,6 +110,12 @@ export class State {
     * Return a string representation of the current state
     */
    toString() {
        return JSON.stringify(this)
        return JSON.stringify({
            "realm": this.realm,
            "sessionUuid": this.sessionUuid,
            "firstStart": this.firstStart,
            "exerciseIndex": this.exerciseIndex,
            "solvedExercises": this.solvedExercises
        })
    }
}