Improves multiple error dialogs appearing when zapping from the reactions bar in the feed.

This commit is contained in:
Vitor Pamplona
2025-03-14 13:57:33 -04:00
parent d76de0123a
commit fd538ebde1
46 changed files with 502 additions and 282 deletions
@@ -25,6 +25,7 @@ import com.vitorpamplona.quartz.nip01Core.core.toHexKey
class KeyPair(
privKey: ByteArray? = null,
pubKey: ByteArray? = null,
forceReplacePubkey: Boolean = true,
) {
val privKey: ByteArray?
val pubKey: ByteArray
@@ -44,7 +45,11 @@ class KeyPair(
} else {
// as private key is provided, ignore the public key and set keys according to private key
this.privKey = privKey
this.pubKey = Nip01.pubKeyCreate(privKey)
if (pubKey == null || forceReplacePubkey) {
this.pubKey = Nip01.pubKeyCreate(privKey)
} else {
this.pubKey = pubKey
}
}
}