chore: improve authentication handling #37

Merged
reya merged 6 commits from fix-nostr-connect into master 2026-07-06 07:33:07 +00:00
2 changed files with 11 additions and 10 deletions
Showing only changes of commit 0ad872d186 - Show all commits

View File

@@ -242,6 +242,7 @@ fun ImportScreen() {
Button(
onClick = {
scope.launch {
try {
if (pubkey == null) {
authViewModel.verifyIdentity(secret).let { pubkey = it }
} else {
@@ -250,6 +251,9 @@ fun ImportScreen() {
// Navigate to the home screen
navigator.navigate(Screen.Home)
}
} catch (e: Exception) {
snackbarHostState.showSnackbar("Error: ${e.message}")
}
}
},

View File

@@ -160,9 +160,6 @@ class AuthViewModel(
suspend fun verifyIdentity(secret: String): PublicKey? {
try {
val signer = createSigner(secret)
if (secret.startsWith("bunker://")) {
showError("Please approve the connection.")
}
return signer.getPublicKeyAsync()
} catch (e: Exception) {
showError("Error: ${e.message}")