Add more stuff to client
This commit is contained in:
@@ -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 = []
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user