-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix hcap detail #212
Fix hcap detail #212
Conversation
@@ -534,7 +534,7 @@ function Details({ | |||
)} | |||
{hcapDetail && ( | |||
<DataField value={ip} label="Hcaptcha"> | |||
{Object.entries(hcapDetail).map(([property, value]) => ( | |||
{hcapDetail.map(({ property, value }) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.map will fail if hcapDetail
undefined so you can either fallback to []
up top or just ?.
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah good looks 👍
const hcapDetail = Array.isArray(repo.hcaptchaDetails) | ||
? (repo.hcaptchaDetails as { property: string; value: string }[]) | ||
: undefined | ||
console.log(hcapDetail) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nix the console.log and we're good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops 🤦
Hcap details were changed from a record format (
{[property]: value}
) to an array format ({property, value}[]
).