new notifications design
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { ExternalStore, FeedCache, dedupe } from "@snort/shared";
|
||||
import { RequestBuilder, NostrEvent, EventKind, SystemInterface } from "@snort/system";
|
||||
import { RequestBuilder, NostrEvent, EventKind, SystemInterface, TaggedRawEvent } from "@snort/system";
|
||||
import { unwrap } from "SnortUtils";
|
||||
import { Chat, ChatSystem, ChatType, lastReadInChat } from "chat";
|
||||
|
||||
@ -31,8 +31,8 @@ export class Nip29ChatSystem extends ExternalStore<Array<Chat>> implements ChatS
|
||||
return rb;
|
||||
}
|
||||
|
||||
async onEvent(evs: NostrEvent[]) {
|
||||
const msg = evs.filter(a => a.kind === EventKind.SimpleChatMessage);
|
||||
async onEvent(evs: readonly TaggedRawEvent[]) {
|
||||
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);
|
||||
this.notifyChange();
|
||||
|
Reference in New Issue
Block a user