diff --git a/components/article/PlatformPicker.tsx b/components/article/PlatformPicker.tsx index d4d8c52ccf07..861a7b11d02d 100644 --- a/components/article/PlatformPicker.tsx +++ b/components/article/PlatformPicker.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from 'react' import Cookies from 'js-cookie' import { SubNav, TabNav, UnderlineNav } from '@primer/components' import { sendEvent, EventType } from 'components/lib/events' +import { useRouter } from 'next/router' import { useArticleContext } from 'components/context/ArticleContext' import parseUserAgent from 'components/lib/user-agent' @@ -50,6 +51,7 @@ type Props = { export const PlatformPicker = ({ variant = 'subnav' }: Props) => { const { defaultPlatform, detectedPlatforms } = useArticleContext() const [currentPlatform, setCurrentPlatform] = useState(defaultPlatform || '') + const { asPath } = useRouter() // Run on mount for client-side only features useEffect(() => { @@ -63,7 +65,7 @@ export const PlatformPicker = ({ variant = 'subnav' }: Props) => { // always trigger this on initial render. if the default doesn't change the other useEffect won't fire showPlatformSpecificContent(platform) - }, []) + }, [asPath]) // Make sure we've always selected a platform that exists in the article useEffect(() => { diff --git a/components/page-header/VersionPicker.tsx b/components/page-header/VersionPicker.tsx index a6fbe81b6420..cd7623b78391 100644 --- a/components/page-header/VersionPicker.tsx +++ b/components/page-header/VersionPicker.tsx @@ -26,8 +26,8 @@ export const VersionPicker = ({ variant }: Props) => { selected: allVersions[currentVersion].versionTitle === permalink.pageVersionTitle, item: {permalink.pageVersionTitle}, })) - const hasEnterpriseVersions = (page.permalinks || []).find((permalink) => - permalink.pageVersion.startsWith('enterprise-version') + const hasEnterpriseVersions = (page.permalinks || []).some((permalink) => + permalink.pageVersion.startsWith('enterprise-server') ) if (hasEnterpriseVersions) { diff --git a/data/ui.yml b/data/ui.yml index 648a99dde5c3..0ecf6148742e 100644 --- a/data/ui.yml +++ b/data/ui.yml @@ -53,7 +53,7 @@ pages: article_version: 'Article version' miniToc: In this article contributor_callout: This article is contributed and maintained by - all_enterprise_releases: All Enterprise releases + all_enterprise_releases: All Enterprise Server releases errors: oops: Ooops! something_went_wrong: It looks like something went wrong.