Support rumors in thunks

This commit is contained in:
Jon Staab
2024-10-08 13:20:43 -07:00
parent da05362bf1
commit a4085af9e3
3 changed files with 59 additions and 29 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
import {parseJson, append, nthNe, nthEq} from "@welshman/lib"
import {Address} from "./Address"
import {uniqTags} from "./Tags"
import {isShareableRelayUrl} from "./Relay"
import {Encryptable, DecryptedEvent} from "./Encryptable"
import type {EncryptableUpdates} from "./Encryptable"
@@ -63,7 +64,7 @@ export const addToListPublicly = (list: List, tag: string[]) => {
const template = {
kind: list.kind,
content: list.event?.content || "",
tags: append(tag, list.publicTags),
tags: uniqTags(append(tag, list.publicTags)),
}
return new Encryptable(template, {})
@@ -76,6 +77,6 @@ export const addToListPrivately = (list: List, tag: string[]) => {
}
return new Encryptable(template, {
content: JSON.stringify(append(tag, list.privateTags)),
content: JSON.stringify(uniqTags(append(tag, list.privateTags))),
})
}