feat: render zap goals

This commit is contained in:
2023-08-20 22:51:56 +01:00
parent d06d6afbf7
commit 35423cc91b
9 changed files with 92 additions and 15 deletions

View File

@ -64,7 +64,7 @@ export class EventPublisher {
/**
* Apply POW to every event
*/
pow(target:number, miner?: PowMiner) {
pow(target: number, miner?: PowMiner) {
this.#pow = target;
this.#miner = miner;
}

View File

@ -180,7 +180,7 @@ export class Query implements QueryBase {
onEvent(sub: string, e: TaggedNostrEvent) {
for (const t of this.#tracing) {
if (t.id === sub) {
if(t.filters.some(v => eventMatchesFilter(e, v))) {
if (t.filters.some(v => eventMatchesFilter(e, v))) {
this.feed.add(e);
} else {
this.#log("Event did not match filter, rejecting %O", e);

View File

@ -49,4 +49,4 @@ export function splitByUrl(str: string) {
/((?:http|ftp|https|nostr|web\+nostr|magnet):\/?\/?(?:[\w+?.\w+])+(?:[a-zA-Z0-9~!@#$%^&*()_\-=+\\/?.:;',]*)?(?:[-A-Za-z0-9+&@#/%=~()_|]))/i;
return str.split(urlRegex);
}
}