From baa9ee05626a645d1ea060e78e9231c2624bd666 Mon Sep 17 00:00:00 2001 From: greenart7c3 Date: Mon, 7 Oct 2024 08:50:06 -0300 Subject: [PATCH] Support for login with hex key when using amber --- .../amethyst/ui/screen/AccountStateViewModel.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/AccountStateViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/AccountStateViewModel.kt index 8df699705..0c9538c81 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/AccountStateViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/AccountStateViewModel.kt @@ -109,7 +109,12 @@ class AccountStateViewModel : ViewModel() { is Nip19Bech32.NEmbed -> null is Nip19Bech32.NRelay -> null is Nip19Bech32.NAddress -> null - else -> null + else -> + try { + if (loginWithExternalSigner) Hex.decode(key) else null + } catch (e: Exception) { + null + } } if (loginWithExternalSigner && pubKeyParsed == null) {