Skip to content

Commit

Permalink
Loop once only when picking point
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciofierrom committed Jul 23, 2024
1 parent 9edf6c3 commit 252ea32
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/javascript/controllers/player/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class EditingState extends PlayerState {
export class PickingPointState extends PlayerState {
async loop(from, to) {
debug("Looping 3 times", { state: this.constructor.name, from, to })
await this.context.loopManager.loop(from, to, 3)
await this.context.loopManager.loop(from, to, 1)
debug("Done point looping. Doing editing loop:", this.context.editState)
this.context.state = this.context.editingState
this.context.editState = { ...this.context.editState, setting: null }
Expand Down
2 changes: 1 addition & 1 deletion test/javascript/controllers/player/state_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe("PlayerState", () => {
playerController.state = playerController.pickingPointState
await playerController.loop(1, 5)

expect(mockLoop).toHaveBeenCalledWith(1, 5, 3)
expect(mockLoop).toHaveBeenCalledWith(1, 5, 1)
expect(playerController.state).toBeInstanceOf(EditingState)
})
})
Expand Down
4 changes: 2 additions & 2 deletions test/javascript/controllers/player_controller_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe("PlayerController", () => {

playerController.updatePoints({detail: { start: 22, end: 77, setting: 22 }})

expect(mockLoop).toHaveBeenCalledWith(22, 25, 3)
expect(mockLoop).toHaveBeenCalledWith(22, 25, 1)
})
})

Expand All @@ -135,7 +135,7 @@ describe("PlayerController", () => {

playerController.updatePoints({detail: { start: 22, end: 77, setting: 22 }})

expect(mockLoop).toHaveBeenCalledWith(22, 25, 3)
expect(mockLoop).toHaveBeenCalledWith(22, 25, 1)
})
})
})
Expand Down

0 comments on commit 252ea32

Please sign in to comment.