From 979c6386efbfc65d36f7215d03fae860650bbc6c Mon Sep 17 00:00:00 2001 From: asonix Date: Tue, 12 Jan 2021 22:35:29 -0600 Subject: [PATCH] Profiles: Only put top-level comments in submission tree --- profiles/src/store/comment.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/profiles/src/store/comment.rs b/profiles/src/store/comment.rs index ceaaa63..6247e94 100644 --- a/profiles/src/store/comment.rs +++ b/profiles/src/store/comment.rs @@ -94,16 +94,17 @@ impl Store { submission_id_key(submission_id, id).as_bytes(), id.as_bytes(), )?; - submission_created_tree.insert( - submission_id_created_comment_key(submission_id, now, id).as_bytes(), - id.as_bytes(), - )?; created_tree.insert(created_comment_key(now, id).as_bytes(), id.as_bytes())?; if let Some(comment_id) = comment_id { reply_created_tree.insert( reply_created_key(comment_id, now, id).as_bytes(), id.as_bytes(), )?; + } else { + submission_created_tree.insert( + submission_id_created_comment_key(submission_id, now, id).as_bytes(), + id.as_bytes(), + )?; } super::count(