Merge pull request #640 from greenart7c3/encryption_amber

try to fix messages being encrypted twice using amber
This commit is contained in:
Vitor Pamplona 2023-10-09 12:14:13 -04:00 committed by GitHub
commit dd2e590475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -274,6 +274,8 @@ object ExternalSignerUtils {
}
fun encrypt(decryptedContent: String, pubKey: HexKey, id: String, signerType: SignerType = SignerType.NIP04_ENCRYPT) {
content.remove(id)
cachedDecryptedContent.remove(id)
val result = getDataFromResolver(signerType, arrayOf(decryptedContent, pubKey))
if (result !== null) {
content.put(id, result)