Skip to content

Commit

Permalink
Only render AlsoOn component when there are links
Browse files Browse the repository at this point in the history
Somehow the existence length check didn't work for empty arrays, but a compare against 0 does.
  • Loading branch information
puf committed Sep 11, 2024
1 parent 0df65df commit db0a5f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/AlsoOn.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function getSocialLinkType(link) {
if (new RegExp("https\://stackoverflow.com/").test(link)) return "stackoverflow";
}
---
{ links?.length && (
{ links?.length > 0 && (
<div class="social-links" style="margin-top: -2em"><span title="Go to one of these if you want to respond...">Also on: </span>
{links.map((link, index) => (
<a href={link}>
Expand Down

0 comments on commit db0a5f2

Please sign in to comment.