upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/ngit/sub_commands/list.rs18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/bin/ngit/sub_commands/list.rs b/src/bin/ngit/sub_commands/list.rs
index 95e17f3..1fe5b49 100644
--- a/src/bin/ngit/sub_commands/list.rs
+++ b/src/bin/ngit/sub_commands/list.rs
@@ -8,7 +8,7 @@ use ngit::{
8 }, 8 },
9 git_events::{ 9 git_events::{
10 KIND_PULL_REQUEST, KIND_PULL_REQUEST_UPDATE, get_commit_id_from_patch, 10 KIND_PULL_REQUEST, KIND_PULL_REQUEST_UPDATE, get_commit_id_from_patch,
11 get_pr_tip_event_or_most_recent_patch_with_ancestors, status_kinds, tag_value, 11 get_pr_tip_event_or_most_recent_patch_with_ancestors, get_status, status_kinds, tag_value,
12 }, 12 },
13}; 13};
14use nostr_sdk::Kind; 14use nostr_sdk::Kind;
@@ -80,21 +80,7 @@ pub async fn launch() -> Result<()> {
80 .collect(); 80 .collect();
81 81
82 for proposal in &proposals { 82 for proposal in &proposals {
83 let status = if let Some(e) = statuses 83 let status = get_status(proposal, &repo_ref, &statuses, &proposals);
84 .iter()
85 .filter(|e| {
86 status_kinds().contains(&e.kind)
87 && e.tags.iter().any(|t| {
88 t.as_slice().len() > 1 && t.as_slice()[1].eq(&proposal.id.to_string())
89 })
90 })
91 .collect::<Vec<&nostr::Event>>()
92 .first()
93 {
94 e.kind
95 } else {
96 Kind::GitStatusOpen
97 };
98 if status.eq(&Kind::GitStatusOpen) { 84 if status.eq(&Kind::GitStatusOpen) {
99 open_proposals.push(proposal); 85 open_proposals.push(proposal);
100 } else if status.eq(&Kind::GitStatusClosed) { 86 } else if status.eq(&Kind::GitStatusClosed) {