No free comments on free response questions
This commit is contained in:
parent
6de12efa99
commit
ed139b6b2b
|
@ -286,6 +286,21 @@ export function getAllContractActivityItems(
|
||||||
]
|
]
|
||||||
: [{ type: 'description', id: '0', contract }]
|
: [{ type: 'description', id: '0', contract }]
|
||||||
|
|
||||||
|
if (outcomeType === 'FREE_RESPONSE') {
|
||||||
|
items.push(
|
||||||
|
...getAnswerGroups(
|
||||||
|
contract as FullContract<DPM, FreeResponse>,
|
||||||
|
bets,
|
||||||
|
comments,
|
||||||
|
user,
|
||||||
|
{
|
||||||
|
sortByProb: true,
|
||||||
|
abbreviated,
|
||||||
|
reversed,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
const commentsWithoutBets = comments
|
const commentsWithoutBets = comments
|
||||||
.filter((comment) => !comment.betId)
|
.filter((comment) => !comment.betId)
|
||||||
.map((comment) => ({
|
.map((comment) => ({
|
||||||
|
@ -317,23 +332,7 @@ export function getAllContractActivityItems(
|
||||||
return item.bets[0].createdTime
|
return item.bets[0].createdTime
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
items.push(...sortedBetsAndComments)
|
items.push(...sortedBetsAndComments)
|
||||||
|
|
||||||
if (outcomeType === 'FREE_RESPONSE') {
|
|
||||||
items.push(
|
|
||||||
...getAnswerGroups(
|
|
||||||
contract as FullContract<DPM, FreeResponse>,
|
|
||||||
bets,
|
|
||||||
comments,
|
|
||||||
user,
|
|
||||||
{
|
|
||||||
sortByProb: true,
|
|
||||||
abbreviated,
|
|
||||||
reversed,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contract.closeTime && contract.closeTime <= Date.now()) {
|
if (contract.closeTime && contract.closeTime <= Date.now()) {
|
||||||
|
|
|
@ -187,10 +187,11 @@ export function CommentInput(props: {
|
||||||
}) {
|
}) {
|
||||||
// see if we can comment input on any bet:
|
// see if we can comment input on any bet:
|
||||||
const { contract, bets, commentsByBetId } = props
|
const { contract, bets, commentsByBetId } = props
|
||||||
|
const { outcomeType } = contract
|
||||||
const user = useUser()
|
const user = useUser()
|
||||||
const [comment, setComment] = useState('')
|
const [comment, setComment] = useState('')
|
||||||
|
|
||||||
if (!user) {
|
if (!user || outcomeType === 'FREE_RESPONSE') {
|
||||||
return <div />
|
return <div />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user