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(
|
||||
(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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user