bug: track started sooner

This commit is contained in:
Kieran 2023-03-03 14:47:14 +00:00
parent 32549522d4
commit 7d4313570e
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,5 @@
import { HexKey, TaggedRawEvent, UserMetadata } from "@snort/nostr"; import { HexKey, TaggedRawEvent, UserMetadata } from "@snort/nostr";
import { hexToBech32 } from "Util"; import { hexToBech32, unixNowMs } from "Util";
export interface MetadataCache extends UserMetadata { export interface MetadataCache extends UserMetadata {
/** /**
@ -30,8 +30,8 @@ export function mapEventToProfile(ev: TaggedRawEvent) {
pubkey: ev.pubkey, pubkey: ev.pubkey,
npub: hexToBech32("npub", ev.pubkey), npub: hexToBech32("npub", ev.pubkey),
created: ev.created_at, created: ev.created_at,
loaded: new Date().getTime(),
...data, ...data,
loaded: unixNowMs(),
} as MetadataCache; } as MetadataCache;
} catch (e) { } catch (e) {
console.error("Failed to parse JSON", ev, e); console.error("Failed to parse JSON", ev, e);

View File

@ -262,6 +262,7 @@ export class Connection {
return; return;
} }
sub.Started.set(this.Address, new Date().getTime());
this._SendSubscription(sub); this._SendSubscription(sub);
this.Subscriptions.set(sub.Id, sub); this.Subscriptions.set(sub.Id, sub);
} }