Skip to content

Commit

Permalink
Merge pull request github#15098 from github/repo-sync
Browse files Browse the repository at this point in the history
repo sync
  • Loading branch information
Octomerger authored Feb 4, 2022
2 parents 162a863 + 213046f commit a78f82b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion components/article/PlatformPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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(() => {
Expand All @@ -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(() => {
Expand Down
4 changes: 2 additions & 2 deletions components/page-header/VersionPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export const VersionPicker = ({ variant }: Props) => {
selected: allVersions[currentVersion].versionTitle === permalink.pageVersionTitle,
item: <Link href={permalink.href}>{permalink.pageVersionTitle}</Link>,
}))
const hasEnterpriseVersions = (page.permalinks || []).find((permalink) =>
permalink.pageVersion.startsWith('enterprise-version')
const hasEnterpriseVersions = (page.permalinks || []).some((permalink) =>
permalink.pageVersion.startsWith('enterprise-server')
)

if (hasEnterpriseVersions) {
Expand Down
2 changes: 1 addition & 1 deletion data/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a78f82b

Please sign in to comment.