Add more stuff to client

This commit is contained in:
Jon Staab
2026-05-05 09:15:31 -07:00
parent e0e9ad5834
commit 28339976b9
12 changed files with 843 additions and 19 deletions
+8 -3
View File
@@ -71,9 +71,7 @@ export class Repository extends Emitter {
return Array.from(this.eventsById.values())
}
load = (events: TrustedEvent[]) => {
const stale = new Set(this.eventsById.keys())
clear = () => {
this.eventsById.clear()
this.eventsByAddress.clear()
this.eventsByTag.clear()
@@ -82,6 +80,13 @@ export class Repository extends Emitter {
this.eventsByKind.clear()
this.deletes.clear()
this.expired.clear()
this.emit("clear")
}
load = (events: TrustedEvent[]) => {
const stale = new Set(this.eventsById.keys())
this.clear()
const added = []
+6 -1
View File
@@ -41,10 +41,15 @@ export class WrapManager extends Emitter {
// Adding/importing
load = (wrapItems: WrapItem[]) => {
clear = () => {
this._wrapIndex.clear()
this._rumorIndex.clear()
this._recipientIndex.clear()
this.emit("load")
}
load = (wrapItems: WrapItem[]) => {
this.clear()
for (const wrapItem of wrapItems) {
this._add(wrapItem)