From 5e561776b46971b83b5c640aa15e01e141548dad Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 28 Jan 2024 21:24:18 +0100 Subject: fix(sys/nixpkgs/pkgs/comments): Append comments to the back of replies This should fix an issue where the comment is appended to the wrong reply chain, when one person has commented twice. This builds on the assumption that comments are sorted by timestamp (which they are in this case). --- sys/nixpkgs/pkgs/comments/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys') diff --git a/sys/nixpkgs/pkgs/comments/src/main.rs b/sys/nixpkgs/pkgs/comments/src/main.rs index de98d75e..05f0e8cd 100644 --- a/sys/nixpkgs/pkgs/comments/src/main.rs +++ b/sys/nixpkgs/pkgs/comments/src/main.rs @@ -227,7 +227,7 @@ fn main() -> anyhow::Result<()> { if let Some(parent) = output_replies .iter_mut() - .rev() + // .rev() .flat_map(|com| &mut com.replies) .flat_map(|com| &mut com.replies) .flat_map(|com| &mut com.replies) @@ -240,7 +240,7 @@ fn main() -> anyhow::Result<()> { })) } else if let Some(parent) = output_replies .iter_mut() - .rev() + // .rev() .flat_map(|com| &mut com.replies) .flat_map(|com| &mut com.replies) .filter(|com| com.value.author == replyee) @@ -252,7 +252,7 @@ fn main() -> anyhow::Result<()> { })) } else if let Some(parent) = output_replies .iter_mut() - .rev() + // .rev() .flat_map(|com| &mut com.replies) .filter(|com| com.value.author == replyee) .last() @@ -262,7 +262,7 @@ fn main() -> anyhow::Result<()> { ..reply.value })) } else if let Some(parent) = output_replies.iter_mut() - .rev() + // .rev() .filter(|com| com.value.author == replyee) .last() { -- cgit 1.4.1