Skip to content

Commit 17962cb

Browse files
authored
Merge pull request #17547 from github/repo-sync
repo sync
2 parents 4a34fc8 + dae27a6 commit 17962cb

File tree

2 files changed

+29
-27
lines changed

2 files changed

+29
-27
lines changed

components/sidebar/RestCollapsibleSection.tsx

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -65,31 +65,33 @@ export const RestCollapsibleSection = (props: SectionProps) => {
6565
}, [])
6666

6767
useEffect(() => {
68-
const observer = new IntersectionObserver(
69-
(entries) => {
70-
entries.forEach((entry) => {
71-
if (entry.target.id) {
72-
const anchor = '#' + entry.target.id.split('--')[0]
73-
if (entry.isIntersecting === true) setVisibleAnchor(anchor)
74-
} else if (router.asPath.includes('#')) {
75-
setVisibleAnchor('#' + router.asPath.split('#')[1])
76-
} else {
77-
setVisibleAnchor('')
78-
}
79-
})
80-
},
81-
{ rootMargin: '0px 0px -85% 0px' }
82-
)
83-
// TODO: When we add the ## About the {title} API to each operation
84-
// we can remove the h2 here
85-
const headingsList = Array.from(document.querySelectorAll('h2, h3'))
86-
87-
headingsList.forEach((heading) => {
88-
observer.observe(heading)
89-
})
90-
91-
return () => {
92-
observer.disconnect()
68+
if (!router.asPath.includes('guides') && !router.asPath.includes('overview')) {
69+
const observer = new IntersectionObserver(
70+
(entries) => {
71+
entries.forEach((entry) => {
72+
if (entry.target.id) {
73+
const anchor = '#' + entry.target.id.split('--')[0]
74+
if (entry.isIntersecting === true) setVisibleAnchor(anchor)
75+
} else if (router.asPath.includes('#')) {
76+
setVisibleAnchor('#' + router.asPath.split('#')[1])
77+
} else {
78+
setVisibleAnchor('')
79+
}
80+
})
81+
},
82+
{ rootMargin: '0px 0px -85% 0px' }
83+
)
84+
// TODO: When we add the ## About the {title} API to each operation
85+
// we can remove the h2 here
86+
const headingsList = Array.from(document.querySelectorAll('h2, h3'))
87+
88+
headingsList.forEach((heading) => {
89+
observer.observe(heading)
90+
})
91+
92+
return () => {
93+
observer.disconnect()
94+
}
9395
}
9496
}, [miniTocItems])
9597
// This wrapper solves the issue of having standalone categories not

pages/[versionId]/rest/overview/endpoints-available-for-github-apps.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export default function Category({ mainContext, enabledForApps, articleContext }
4444
</h3>
4545
)}
4646
<ul>
47-
{operations.map((operation) => (
48-
<li key={`enabledAppOperation-${operation.slug}`}>
47+
{operations.map((operation, index) => (
48+
<li key={`enabledAppOperation-${operation.slug}-${index}`}>
4949
<Link href={`/${locale}/rest/reference/${category}#${operation.slug}`}>
5050
<code>
5151
<span className="text-uppercase">{operation.verb}</span> {operation.requestPath}

0 commit comments

Comments
 (0)