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:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-05-28 10:55:04 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2025-05-28 10:55:04 +0100
commitd53f4abfd68f3b7b08d967f861b297dee5bdb5b4 (patch)
treeec59411c773cc2569a2c11bdf95fbac96e62eabe /src
parentb98d2819288f86dd5b316c726cda0f84a1f63eb5 (diff)
fix: use most recent, rather than oldest state event found
this was identified when testing with multiple maintainers
Diffstat (limited to 'src')
-rw-r--r--src/lib/repo_state.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/repo_state.rs b/src/lib/repo_state.rs
index c3a7606..ebd8e7f 100644
--- a/src/lib/repo_state.rs
+++ b/src/lib/repo_state.rs
@@ -12,7 +12,7 @@ pub struct RepoState {
12impl RepoState { 12impl RepoState {
13 pub fn try_from(mut state_events: Vec<nostr::Event>) -> Result<Self> { 13 pub fn try_from(mut state_events: Vec<nostr::Event>) -> Result<Self> {
14 state_events.sort_by_key(|e| e.created_at); 14 state_events.sort_by_key(|e| e.created_at);
15 let event = state_events.first().context("no state events")?; 15 let event = state_events.last().context("no state events")?;
16 let mut state = HashMap::new(); 16 let mut state = HashMap::new();
17 for tag in event.tags.iter() { 17 for tag in event.tags.iter() {
18 if let Some(name) = tag.as_slice().first() { 18 if let Some(name) = tag.as_slice().first() {