No free comments on free response questions

This commit is contained in:
Ian Philips 2022-04-21 09:31:01 -06:00
parent 6de12efa99
commit ed139b6b2b
2 changed files with 35 additions and 35 deletions

View File

@ -286,6 +286,21 @@ export function getAllContractActivityItems(
]
: [{ 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
.filter((comment) => !comment.betId)
.map((comment) => ({
@ -317,23 +332,7 @@ export function getAllContractActivityItems(
return item.bets[0].createdTime
}
})
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()) {

View File

@ -187,10 +187,11 @@ export function CommentInput(props: {
}) {
// see if we can comment input on any bet:
const { contract, bets, commentsByBetId } = props
const { outcomeType } = contract
const user = useUser()
const [comment, setComment] = useState('')
if (!user) {
if (!user || outcomeType === 'FREE_RESPONSE') {
return <div />
}