From 07171f7f08b18b3521504d4b0f5d7c6d6d7c2dfc Mon Sep 17 00:00:00 2001 From: Thomas Mathews Date: Thu, 29 Dec 2022 10:42:00 -0800 Subject: [PATCH] Fix for contacts loading from relay. --- js/contacts.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/contacts.js b/js/contacts.js index 0754f7a..4e006b9 100644 --- a/js/contacts.js +++ b/js/contacts.js @@ -7,7 +7,10 @@ function contact_is_friend(contacts, pk) { function contacts_process_event(contacts, our_pubkey, ev) { if (ev.pubkey !== our_pubkey) return; + if (contacts.event && ev.created_at < contacts.event.created_at) + return; contacts.event = ev + contacts.friends = new Set(); for (const tag of ev.tags) { if (tag.length > 1 && tag[0] === "p") { contacts.friends.add(tag[1])