diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-02-23 15:30:03 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-02-23 15:30:03 +0000 |
| commit | e406e44f32ea737bd9d0070acb7cf99ce1e1c33a (patch) | |
| tree | 4d08d3800a3decb4c14b9bdbb5d4188f1b1e00f4 /src/sub_commands | |
| parent | d3bf05365ff2d360d53abe2324f42d98f0c1779c (diff) | |
feat(list): newest proposals firsts
show proposals in order newest first
Diffstat (limited to 'src/sub_commands')
| -rw-r--r-- | src/sub_commands/list.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sub_commands/list.rs b/src/sub_commands/list.rs index f7397f1..ad5a28d 100644 --- a/src/sub_commands/list.rs +++ b/src/sub_commands/list.rs | |||
| @@ -732,7 +732,7 @@ pub async fn find_proposal_events( | |||
| 732 | repo_ref: &RepoRef, | 732 | repo_ref: &RepoRef, |
| 733 | root_commit: &str, | 733 | root_commit: &str, |
| 734 | ) -> Result<Vec<nostr::Event>> { | 734 | ) -> Result<Vec<nostr::Event>> { |
| 735 | Ok(client | 735 | let mut proposals = client |
| 736 | .get_events( | 736 | .get_events( |
| 737 | repo_ref.relays.clone(), | 737 | repo_ref.relays.clone(), |
| 738 | vec![ | 738 | vec![ |
| @@ -773,7 +773,10 @@ pub async fn find_proposal_events( | |||
| 773 | })) | 773 | })) |
| 774 | }) | 774 | }) |
| 775 | .map(std::borrow::ToOwned::to_owned) | 775 | .map(std::borrow::ToOwned::to_owned) |
| 776 | .collect::<Vec<nostr::Event>>()) | 776 | .collect::<Vec<nostr::Event>>(); |
| 777 | proposals.sort_by_key(|e| e.created_at); | ||
| 778 | proposals.reverse(); | ||
| 779 | Ok(proposals) | ||
| 777 | } | 780 | } |
| 778 | 781 | ||
| 779 | pub async fn find_commits_for_proposal_root_events( | 782 | pub async fn find_commits_for_proposal_root_events( |