fix: distinguish comment/post/private message ids in reports view

This commit is contained in:
Xylight committed 2025-10-21 06:36:16 -07:00
1 parent 98d56a0a0f
commit ba8c2ae0dd
1 file changed
+4 -4
+4 -4
View File
@@ -52,17 +52,17 @@ export async function load({ url, fetch }) {
const grouped = everything.reduce( const grouped = everything.reduce(
(groups, item) => { (groups, item) => {
const key = isPostView(item.item) const key = isPostView(item.item)
? item.item.post.id ? `post-${item.item.post.id}`
: isCommentView(item.item) : isCommentView(item.item)
? item.item.comment.id ? `comment-${item.item.comment.id}`
: item.item.id : `pm-${item.item.id}`
if (!groups[key]) { if (!groups[key]) {
groups[key] = [] groups[key] = []
} }
groups[key].push(item) groups[key].push(item)
return groups return groups
}, },
{} as Record<number, ReportView[]>, {} as Record<string, ReportView[]>,
) )
return { return {