From 715594986bfd0197632fb6c5422248c0fcb8196a Mon Sep 17 00:00:00 2001 From: Kieran Date: Tue, 17 Jan 2023 14:17:41 +0000 Subject: [PATCH] bug: use latest profile --- src/nostr/System.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nostr/System.ts b/src/nostr/System.ts index 4ad8822a..354d0b40 100644 --- a/src/nostr/System.ts +++ b/src/nostr/System.ts @@ -178,7 +178,10 @@ export class NostrSystem { sub.OnEvent = async (e) => { let profile = mapEventToProfile(e); if (profile) { - await db.users.put(profile); + let existing = await db.users.get(profile.pubkey); + if((existing?.created ?? 0) < profile.created) { + await db.users.put(profile); + } } } let results = await this.RequestSubscription(sub);