fix: readonly feed loading

This commit is contained in:
2023-09-25 12:11:56 +01:00
parent 8e414a10c5
commit 875348cc03
5 changed files with 53 additions and 55 deletions

View File

@ -24,7 +24,9 @@ export class GiftWrapCache extends RefreshFeedCache<UnwrappedGift> {
return [...this.cache.values()];
}
override async onEvent(evs: Array<TaggedNostrEvent>, pub: EventPublisher) {
override async onEvent(evs: Array<TaggedNostrEvent>, pub?: EventPublisher) {
if (!pub) return;
const unwrapped = (
await Promise.all(
evs.map(async v => {

View File

@ -6,7 +6,7 @@ export type TWithCreated<T> = (T | Readonly<T>) & { created_at: number };
export abstract class RefreshFeedCache<T> extends FeedCache<TWithCreated<T>> {
abstract buildSub(session: LoginSession, rb: RequestBuilder): void;
abstract onEvent(evs: Readonly<Array<TaggedNostrEvent>>, pub: EventPublisher): void;
abstract onEvent(evs: Readonly<Array<TaggedNostrEvent>>, pub?: EventPublisher): void;
/**
* Get latest event