fix(search): intercept nsec1, delete, and show warning
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 52s
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 52s
This commit is contained in:
parent
f7d0718b78
commit
4b5625e5bd
@ -1045,6 +1045,11 @@ export const CreatePage = () => {
|
|||||||
// Seems like it's npub format
|
// Seems like it's npub format
|
||||||
if (value.trim().startsWith('npub1')) {
|
if (value.trim().startsWith('npub1')) {
|
||||||
setPastedUserNpubOrNip05(value.trim())
|
setPastedUserNpubOrNip05(value.trim())
|
||||||
|
} else if (value.trim().startsWith('nsec1')) {
|
||||||
|
toast.warn('Oops - never paste your nsec into a website! Key deleted.')
|
||||||
|
if (searchFieldRef.current) searchFieldRef.current.value = ''
|
||||||
|
setUserSearchInput('')
|
||||||
|
return
|
||||||
} else {
|
} else {
|
||||||
// Disarm the add user on enter hit, and trigger search after 1 second
|
// Disarm the add user on enter hit, and trigger search after 1 second
|
||||||
disarmAddOnEnter()
|
disarmAddOnEnter()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user