bug: use latest profile
This commit is contained in:
parent
dda07d66d5
commit
715594986b
@ -178,9 +178,12 @@ export class NostrSystem {
|
|||||||
sub.OnEvent = async (e) => {
|
sub.OnEvent = async (e) => {
|
||||||
let profile = mapEventToProfile(e);
|
let profile = mapEventToProfile(e);
|
||||||
if (profile) {
|
if (profile) {
|
||||||
|
let existing = await db.users.get(profile.pubkey);
|
||||||
|
if((existing?.created ?? 0) < profile.created) {
|
||||||
await db.users.put(profile);
|
await db.users.put(profile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
let results = await this.RequestSubscription(sub);
|
let results = await this.RequestSubscription(sub);
|
||||||
let couldNotFetch = Array.from(missing).filter(a => !results.some(b => b.pubkey === a));
|
let couldNotFetch = Array.from(missing).filter(a => !results.some(b => b.pubkey === a));
|
||||||
console.debug("No profiles: ", couldNotFetch);
|
console.debug("No profiles: ", couldNotFetch);
|
||||||
|
Loading…
Reference in New Issue
Block a user