Service worker precache
Yarn upgrades / cleanup
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { EventKind, NostrEvent, RequestBuilder, TaggedRawEvent } from "@snort/system";
|
||||
import { EventKind, NostrEvent, RequestBuilder, TaggedNostrEvent } from "@snort/system";
|
||||
import { RefreshFeedCache, TWithCreated } from "./RefreshFeedCache";
|
||||
import { LoginSession } from "Login";
|
||||
import { unixNow } from "SnortUtils";
|
||||
@ -21,7 +21,7 @@ export class NotificationsCache extends RefreshFeedCache<NostrEvent> {
|
||||
}
|
||||
}
|
||||
|
||||
async onEvent(evs: readonly TaggedRawEvent[]) {
|
||||
async onEvent(evs: readonly TaggedNostrEvent[]) {
|
||||
const filtered = evs.filter(a => this.#kinds.includes(a.kind) && a.tags.some(b => b[0] === "p"));
|
||||
if (filtered.length > 0) {
|
||||
await this.bulkSet(filtered);
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { FeedCache } from "@snort/shared";
|
||||
import { RequestBuilder, TaggedRawEvent } from "@snort/system";
|
||||
import { RequestBuilder, TaggedNostrEvent } from "@snort/system";
|
||||
import { LoginSession } from "Login";
|
||||
|
||||
export type TWithCreated<T> = 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<TaggedRawEvent>>): void;
|
||||
abstract onEvent(evs: Readonly<Array<TaggedNostrEvent>>): void;
|
||||
|
||||
/**
|
||||
* Get latest event
|
||||
|
Reference in New Issue
Block a user