forked from Kieran/snort
bug: track started sooner
This commit is contained in:
parent
32549522d4
commit
7d4313570e
@ -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);
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user