protect against comment root not having forwards

This commit is contained in:
keyan 2023-09-26 15:15:31 -05:00
parent 32847670e2
commit f27cd2d6dd
1 changed files with 1 additions and 1 deletions

View File

@ -132,7 +132,7 @@ export default function Comment ({
// Don't show OP badge when anon user comments on anon user posts // Don't show OP badge when anon user comments on anon user posts
const op = root.user.name === item.user.name && Number(item.user.id) !== ANON_USER_ID const op = root.user.name === item.user.name && Number(item.user.id) !== ANON_USER_ID
? 'OP' ? 'OP'
: root.forwards.some(f => f.user.name === item.user.name) && Number(item.user.id) !== ANON_USER_ID : root.forwards?.some(f => f.user.name === item.user.name) && Number(item.user.id) !== ANON_USER_ID
? 'OPG' ? 'OPG'
: null : null
const bountyPaid = root.bountyPaidTo?.includes(Number(item.id)) const bountyPaid = root.bountyPaidTo?.includes(Number(item.id))