fix: update lightning address validation

handle 404 responses in lightning addresses validation

closes issue #70
This commit is contained in:
MTG2000
2022-07-11 15:49:01 +03:00
parent 3f6c344d16
commit 6319e23dae

View File

@@ -30,9 +30,10 @@ const schema: yup.SchemaOf<IFormInputs> = yup.object({
if (value) {
const [name, domain] = value.split("@");
const lnurl = `https://${domain}/.well-known/lnurlp/${name}`;
await fetch(lnurl);
const res = await fetch(lnurl);
if (res.status === 200) return true;
}
return true;
return false;
} catch (error) {
return false;
}
@@ -141,7 +142,7 @@ export default function UpdateAboutForm({ data, onClose }: Props) {
type='text'
className="input-text"
placeholder="UK, London"
placeholder="Back-end Developer"
{...register("jobTitle")}
/>
</div>