remove toast message
This commit is contained in:
@@ -242,13 +242,17 @@ fun ImportScreen() {
|
|||||||
Button(
|
Button(
|
||||||
onClick = {
|
onClick = {
|
||||||
scope.launch {
|
scope.launch {
|
||||||
if (pubkey == null) {
|
try {
|
||||||
authViewModel.verifyIdentity(secret).let { pubkey = it }
|
if (pubkey == null) {
|
||||||
} else {
|
authViewModel.verifyIdentity(secret).let { pubkey = it }
|
||||||
// Import the identity
|
} else {
|
||||||
authViewModel.importIdentity(secret)
|
// Import the identity
|
||||||
// Navigate to the home screen
|
authViewModel.importIdentity(secret)
|
||||||
navigator.navigate(Screen.Home)
|
// Navigate to the home screen
|
||||||
|
navigator.navigate(Screen.Home)
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
snackbarHostState.showSnackbar("Error: ${e.message}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -160,9 +160,6 @@ class AuthViewModel(
|
|||||||
suspend fun verifyIdentity(secret: String): PublicKey? {
|
suspend fun verifyIdentity(secret: String): PublicKey? {
|
||||||
try {
|
try {
|
||||||
val signer = createSigner(secret)
|
val signer = createSigner(secret)
|
||||||
if (secret.startsWith("bunker://")) {
|
|
||||||
showError("Please approve the connection.")
|
|
||||||
}
|
|
||||||
return signer.getPublicKeyAsync()
|
return signer.getPublicKeyAsync()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showError("Error: ${e.message}")
|
showError("Error: ${e.message}")
|
||||||
|
|||||||
Reference in New Issue
Block a user