bug: use latest profile
This commit is contained in:
parent
dda07d66d5
commit
715594986b
|
@ -178,7 +178,10 @@ export class NostrSystem {
|
||||||
sub.OnEvent = async (e) => {
|
sub.OnEvent = async (e) => {
|
||||||
let profile = mapEventToProfile(e);
|
let profile = mapEventToProfile(e);
|
||||||
if (profile) {
|
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);
|
let results = await this.RequestSubscription(sub);
|
||||||
|
|
Loading…
Reference in New Issue