File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -128,13 +128,16 @@ const DocsNav = ({ contentNotTranslated }: DocsNavProps) => {
128
128
// Find index that matches current page
129
129
let currentIndex = 0
130
130
for ( let i = 0 ; i < docsArray . length ; i ++ ) {
131
- if ( asPath . indexOf ( docsArray [ i ] . to ) > - 1 ) {
131
+ if (
132
+ asPath . indexOf ( docsArray [ i ] . to ) >= 0 &&
133
+ asPath . length === docsArray [ i ] . to . length
134
+ ) {
132
135
currentIndex = i
133
136
}
134
137
}
135
138
136
139
// Extract previous and next doc based on current index +/- 1
137
- const previousDoc = currentIndex - 1 > 0 ? docsArray [ currentIndex - 1 ] : null
140
+ const previousDoc = currentIndex - 1 >= 0 ? docsArray [ currentIndex - 1 ] : null
138
141
const nextDoc =
139
142
currentIndex + 1 < docsArray . length ? docsArray [ currentIndex + 1 ] : null
140
143
You can’t perform that action at this time.
0 commit comments