Skip to content

Commit

Permalink
fix bug of 'facts' when clicking on nextSeg in period 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jajakob committed Jun 12, 2024
1 parent 9973b2c commit 1942390
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/platform/src/services/GameService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ export function computeSegmentStartResults(game, ctx, { reducers }) {
const results = game.activePeriod.results
.filter((result) => result.type === DB.PlayerResultType.PERIOD_START)
.reduce((acc, result, ix, allResults) => {
const { result: facts } = reducers.SegmentResult.apply(result.facts, {
let { result: facts } = reducers.SegmentResult.apply(result.facts, {
type: reducers.SegmentResult.ActionTypes.SEGMENT_RESULTS_INITIALIZE,
payload: {
playerRole: result.player.role,
Expand All @@ -1278,6 +1278,11 @@ export function computeSegmentStartResults(game, ctx, { reducers }) {
},
})

// TODO(JJ): Double-check with RS
if (facts.facts) {
facts = facts.facts
}

const common = {
facts,
periodIx: game.activePeriodIx,
Expand Down

0 comments on commit 1942390

Please sign in to comment.