This commit is contained in:
2026-06-01 20:45:37 +07:00
parent b1d9135394
commit 9629162d0c
3 changed files with 16 additions and 10 deletions

View File

@@ -375,13 +375,16 @@ class NostrViewModel(
}
suspend fun verifyIdentity(secret: String): PublicKey? {
return runCatching {
try {
val signer = createSigner(secret)
if (secret.startsWith("bunker://")) {
showError("Please approve the connection.")
}
signer.getPublicKeyAsync()
}.getOrNull()
return signer.getPublicKeyAsync()
} catch (e: Exception) {
showError("Error: ${e.message}")
return null
}
}
suspend fun importIdentity(secret: String) {
@@ -394,7 +397,7 @@ class NostrViewModel(
showError("Error: ${e.message}")
} finally {
_signerRequired.value = false
_isLoggedIn.value = true
_isLoggedIn.value = false
}
}