Fix tags on deletes other than a/e

This commit is contained in:
Jon Staab
2024-12-16 13:30:17 -08:00
parent f26c150d21
commit 8825ed4d57
2 changed files with 56 additions and 54 deletions
+1 -1
View File
@@ -222,7 +222,7 @@ export class Repository<E extends HashedEvent = TrustedEvent> extends Emitter {
// If this is a delete event, the tag value is an id or address. Track when it was
// deleted so that replaceables can be restored.
if (event.kind === DELETE) {
if (event.kind === DELETE && ["a", "e"].includes(tag[0]) && tag[1]) {
this.deletes.set(tag[1], Math.max(event.created_at, this.deletes.get(tag[1]) || 0))
const deletedEvent = this.getEvent(tag[1])