@@ -65,31 +65,33 @@ export const RestCollapsibleSection = (props: SectionProps) => {
65
65
} , [ ] )
66
66
67
67
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
+ }
93
95
}
94
96
} , [ miniTocItems ] )
95
97
// This wrapper solves the issue of having standalone categories not
0 commit comments