Use fetch().then()

This commit is contained in:
Nic Lake 2024-05-28 10:40:12 -05:00
parent 77b165637d
commit a2c54c1da0

View file

@ -19,7 +19,7 @@ export default function Person({ person }) {
: null;
const webfinger =
person.mastodon
? JSON.parse(`https://${mastodonArr[0]}/.well-known/webfinger?resource=https://${mastodonArr[0]}/@${mastodonArr[1]}`)
? fetch(`https://${mastodonArr[0]}/.well-known/webfinger?resource=https://${mastodonArr[0]}/@${mastodonArr[1]}`).then(response => response.json())
: null;
const wfIndex =
person.mastodon && webfinger