Service worker precache
Yarn upgrades / cleanup
This commit is contained in:
@ -9,7 +9,7 @@ import {
|
||||
SystemInterface,
|
||||
TLVEntry,
|
||||
TLVEntryType,
|
||||
TaggedRawEvent,
|
||||
TaggedNostrEvent,
|
||||
UserMetadata,
|
||||
encodeTLVEntries,
|
||||
} from "@snort/system";
|
||||
@ -61,7 +61,7 @@ export interface ChatSystem {
|
||||
* Create a request for this system to get updates
|
||||
*/
|
||||
subscription(id: string): RequestBuilder | undefined;
|
||||
onEvent(evs: readonly TaggedRawEvent[]): Promise<void> | void;
|
||||
onEvent(evs: readonly TaggedNostrEvent[]): Promise<void> | void;
|
||||
|
||||
listChats(pk: string): Array<Chat>;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ExternalStore, FeedCache, dedupe } from "@snort/shared";
|
||||
import { RequestBuilder, NostrEvent, EventKind, SystemInterface, TaggedRawEvent } from "@snort/system";
|
||||
import { RequestBuilder, NostrEvent, EventKind, SystemInterface, TaggedNostrEvent } from "@snort/system";
|
||||
import { unwrap } from "SnortUtils";
|
||||
import { Chat, ChatSystem, ChatType, lastReadInChat } from "chat";
|
||||
|
||||
@ -31,7 +31,7 @@ export class Nip29ChatSystem extends ExternalStore<Array<Chat>> implements ChatS
|
||||
return rb;
|
||||
}
|
||||
|
||||
async onEvent(evs: readonly TaggedRawEvent[]) {
|
||||
async onEvent(evs: readonly TaggedNostrEvent[]) {
|
||||
const msg = evs.filter(a => a.kind === EventKind.SimpleChatMessage && a.tags.some(b => b[0] === "g"));
|
||||
if (msg.length > 0) {
|
||||
await this.#cache.bulkSet(msg);
|
||||
|
Reference in New Issue
Block a user