Answer group feed: Always include answer of last bet.

This commit is contained in:
James Grugett 2022-03-14 19:39:40 -05:00
parent a82b3577d4
commit db7eee495c

View File

@ -188,11 +188,16 @@ function getAnswerGroups(
const lastCommentOutcome = bets.find(
(bet) => bet.id === lastComment?.betId
)?.outcome
if (lastCommentOutcome) {
outcomes = [
...outcomes.filter((outcome) => outcome !== lastCommentOutcome),
const lastBetOutcome = _.last(bets)?.outcome
if (lastCommentOutcome && lastBetOutcome) {
outcomes = _.uniq([
...outcomes.filter(
(outcome) =>
outcome !== lastCommentOutcome && outcome !== lastBetOutcome
),
lastCommentOutcome,
]
lastBetOutcome,
])
}
outcomes = outcomes.slice(-2)
}