Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/notify-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: nodejs/web-team/actions/notify-on-push@2c2897a93eb99b4cdca270729100bc0887c758d9
with:
webhook: ${{ secrets.SLACK_WEBHOOK }}
2 changes: 1 addition & 1 deletion apps/site/components/withDownloadSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const WithDownloadSection: FC<WithDownloadSectionProps> = ({
// Decides which initial release to use based on the current pathname
const initialRelease = pathname.endsWith('/current')
? 'Current'
: 'Active LTS';
: ['Active LTS' as const, 'Maintenance LTS' as const];

return (
<WithNodeRelease status={initialRelease}>
Expand Down
2 changes: 1 addition & 1 deletion apps/site/components/withFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const WithFooter: FC = () => {

const primary = (
<div className="flex flex-row gap-2">
<WithNodeRelease status="Active LTS">
<WithNodeRelease status={['Active LTS', 'Maintenance LTS']}>
{({ release }) => (
<BadgeGroup
size="small"
Expand Down
16 changes: 11 additions & 5 deletions apps/site/components/withNodeRelease.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ const WithNodeRelease: FC<WithNodeReleaseProps> = async ({
}) => {
const releaseData = await provideReleaseData();

const matchingRelease = releaseData.find(release =>
[status].flat().includes(release.status)
);
let matchingRelease: NodeRelease | undefined;
for (const statusItem of Array.isArray(status) ? status : [status]) {
matchingRelease = releaseData.find(
release => release.status === statusItem
);
if (matchingRelease) {
break;
}
}

if (matchingRelease !== undefined) {
return <Component release={matchingRelease!} />;
if (matchingRelease) {
return <Component release={matchingRelease} />;
}

return null;
Expand Down
Loading
Loading