refactor: remove electron-related code
This commit is contained in:
parent
bed8df06e8
commit
2b1e6fe8f5
200 changed files with 2771 additions and 8432 deletions
19
src/hooks/useFetchNip05.tsx
Normal file
19
src/hooks/useFetchNip05.tsx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { verifyNip05 } from '@/lib/nip05'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
export function useFetchNip05(nip05?: string, pubkey?: string) {
|
||||
const [nip05IsVerified, setNip05IsVerified] = useState(false)
|
||||
const [nip05Name, setNip05Name] = useState<string>('')
|
||||
const [nip05Domain, setNip05Domain] = useState<string>('')
|
||||
|
||||
useEffect(() => {
|
||||
if (!nip05 || !pubkey) return
|
||||
verifyNip05(nip05, pubkey).then(({ isVerified, nip05Name, nip05Domain }) => {
|
||||
setNip05IsVerified(isVerified)
|
||||
setNip05Name(nip05Name)
|
||||
setNip05Domain(nip05Domain)
|
||||
})
|
||||
}, [nip05, pubkey])
|
||||
|
||||
return { nip05IsVerified, nip05Name, nip05Domain }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue