Answer group feed: Always include answer of last bet.
This commit is contained in:
parent
a82b3577d4
commit
db7eee495c
|
@ -188,11 +188,16 @@ function getAnswerGroups(
|
||||||
const lastCommentOutcome = bets.find(
|
const lastCommentOutcome = bets.find(
|
||||||
(bet) => bet.id === lastComment?.betId
|
(bet) => bet.id === lastComment?.betId
|
||||||
)?.outcome
|
)?.outcome
|
||||||
if (lastCommentOutcome) {
|
const lastBetOutcome = _.last(bets)?.outcome
|
||||||
outcomes = [
|
if (lastCommentOutcome && lastBetOutcome) {
|
||||||
...outcomes.filter((outcome) => outcome !== lastCommentOutcome),
|
outcomes = _.uniq([
|
||||||
|
...outcomes.filter(
|
||||||
|
(outcome) =>
|
||||||
|
outcome !== lastCommentOutcome && outcome !== lastBetOutcome
|
||||||
|
),
|
||||||
lastCommentOutcome,
|
lastCommentOutcome,
|
||||||
]
|
lastBetOutcome,
|
||||||
|
])
|
||||||
}
|
}
|
||||||
outcomes = outcomes.slice(-2)
|
outcomes = outcomes.slice(-2)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user