Skip to content

Commit

Permalink
Fix bug for ghec version of experimental pages (github#30494)
Browse files Browse the repository at this point in the history
  • Loading branch information
gracepark authored Sep 6, 2022
1 parent 219638d commit b84b627
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions components/context/PlaygroundContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ export const PlaygroundContextProvider = (props: { children: React.ReactNode })
const router = useRouter()
const [activeSectionIndex, setActiveSectionIndex] = useState(0)
const [scrollToSection, setScrollToSection] = useState<number>()
const path = router.asPath.split('?')[0].split('#')[0]

const path = router.asPath.includes('@latest')
? router.asPath.split('?')[0].split('#')[0].split('@latest')[1]
: router.asPath.split('?')[0].split('#')[0]
const relevantArticles = articles.filter(({ slug }) => slug === path)

const { langId } = router.query
Expand Down
2 changes: 1 addition & 1 deletion components/playground/CodeLanguagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const CodeLanguagePicker = () => {
<SubNav.Link
key={language.id}
as={Link}
href={`${routePath}?langId=${language.id}`}
href={`/${router.locale}${routePath}?langId=${language.id}`}
selected={language.id === currentLanguage.id}
>
{language.label}
Expand Down

0 comments on commit b84b627

Please sign in to comment.