mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 23:47:12 +02:00
refactor: use onlyEvents helper from applesauce-relay
Replace inline type guard filter with the built-in onlyEvents() operator. https://claude.ai/code/session_01CCxAcUsRBkWSL6as1wtFoA
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { BehaviorSubject, firstValueFrom, type Observable } from "rxjs";
|
||||
import { filter, first, take, timeout, catchError } from "rxjs/operators";
|
||||
import { first, take, timeout, catchError } from "rxjs/operators";
|
||||
import { of } from "rxjs";
|
||||
import { onlyEvents } from "applesauce-relay/operators";
|
||||
import { kinds, type Filter } from "nostr-tools";
|
||||
import {
|
||||
getProfileContent,
|
||||
@@ -165,7 +166,7 @@ class GroupMetadataCache {
|
||||
try {
|
||||
const event = await firstValueFrom(
|
||||
pool.subscription([relayUrl], [filterDef], { eventStore }).pipe(
|
||||
filter((r): r is NostrEvent => typeof r !== "string"),
|
||||
onlyEvents(),
|
||||
take(1),
|
||||
timeout(timeoutMs),
|
||||
catchError(() => of(undefined as NostrEvent | undefined)),
|
||||
|
||||
Reference in New Issue
Block a user