From fff0fd762dc0b3ddde04657207d09c795cdaa341 Mon Sep 17 00:00:00 2001 From: SwiftHawk Date: Mon, 3 Jun 2024 12:13:37 +0500 Subject: [PATCH] fix: convert npub/nip05 to lowercase on adding as signer/viewer --- src/pages/create/index.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/create/index.tsx b/src/pages/create/index.tsx index 1a3d207..cc83eaa 100644 --- a/src/pages/create/index.tsx +++ b/src/pages/create/index.tsx @@ -130,8 +130,10 @@ export const CreatePage = () => { }) } - if (userInput.startsWith('npub')) { - const pubkey = npubToHex(userInput) + const input = userInput.toLowerCase() + + if (input.startsWith('npub')) { + const pubkey = npubToHex(input) if (pubkey) { addUser(pubkey) setUserInput('') @@ -141,12 +143,12 @@ export const CreatePage = () => { return } - if (userInput.includes('@')) { + if (input.includes('@')) { setIsLoading(true) setLoadingSpinnerDesc('Querying for nip05') - const nip05Profile = await queryNip05(userInput) + const nip05Profile = await queryNip05(input) .catch((err) => { - console.error(`error occurred in querying nip05: ${userInput}`, err) + console.error(`error occurred in querying nip05: ${input}`, err) return null }) .finally(() => { -- 2.34.1