bug: use latest profile

This commit is contained in:
Kieran 2023-01-17 14:17:41 +00:00
parent dda07d66d5
commit 715594986b
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
1 changed files with 4 additions and 1 deletions

View File

@ -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);