fix: search counterparts nip05 does not need to include '@'
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 50s
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 50s
This commit is contained in:
parent
0fd0f26fc7
commit
7b29d7055e
@ -251,10 +251,15 @@ export const CreatePage = () => {
|
||||
} else {
|
||||
// Otherwize if search already provided some results, user must manually click the search button
|
||||
if (!foundUsers.length) {
|
||||
// If it's NIP05 send request to .well-known
|
||||
if (userSearchInput.includes('@')) {
|
||||
// If it's NIP05 (includes @ or is a valid domain) send request to .well-known
|
||||
const domainRegex = /^[a-zA-Z0-9@.-]+\.[a-zA-Z]{2,}$/
|
||||
if (domainRegex.test(userSearchInput)) {
|
||||
setSearchUsersLoading(true)
|
||||
|
||||
const pubkey = await handleSearchUserNip05(userSearchInput)
|
||||
|
||||
setSearchUsersLoading(false)
|
||||
|
||||
if (pubkey) {
|
||||
setUserInput(userSearchInput)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user