diff --git a/composeApp/src/androidMain/kotlin/su/reya/coop/screens/ImportScreen.kt b/composeApp/src/androidMain/kotlin/su/reya/coop/screens/ImportScreen.kt index aea7ee5..32f7259 100644 --- a/composeApp/src/androidMain/kotlin/su/reya/coop/screens/ImportScreen.kt +++ b/composeApp/src/androidMain/kotlin/su/reya/coop/screens/ImportScreen.kt @@ -242,13 +242,17 @@ fun ImportScreen() { Button( onClick = { scope.launch { - if (pubkey == null) { - authViewModel.verifyIdentity(secret).let { pubkey = it } - } else { - // Import the identity - authViewModel.importIdentity(secret) - // Navigate to the home screen - navigator.navigate(Screen.Home) + try { + if (pubkey == null) { + authViewModel.verifyIdentity(secret).let { pubkey = it } + } else { + // Import the identity + authViewModel.importIdentity(secret) + // Navigate to the home screen + navigator.navigate(Screen.Home) + } + } catch (e: Exception) { + snackbarHostState.showSnackbar("Error: ${e.message}") } } diff --git a/shared/src/commonMain/kotlin/su/reya/coop/viewmodel/AuthViewModel.kt b/shared/src/commonMain/kotlin/su/reya/coop/viewmodel/AuthViewModel.kt index 5d8b226..12dfa8c 100644 --- a/shared/src/commonMain/kotlin/su/reya/coop/viewmodel/AuthViewModel.kt +++ b/shared/src/commonMain/kotlin/su/reya/coop/viewmodel/AuthViewModel.kt @@ -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}")