Skip to content

Commit c634f36

Browse files
committed
fix selector for non core/stdlib modules
1 parent f4a9971 commit c634f36

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/ApiDocs.res

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,14 @@ module SidebarTree = {
172172
ReactEvent.Form.preventDefault(evt)
173173
let version = (evt->ReactEvent.Form.target)["value"]
174174
let url = Url.parse(router.asPath)
175-
if version < "v12.0.0" {
176-
url.pagepath[1] = "core"
177-
} else {
178-
url.pagepath[1] = "stdlib"
175+
switch url.pagepath[1] {
176+
| Some("core") | Some("stdlib") =>
177+
if version < "v12.0.0" {
178+
url.pagepath[1] = "core"
179+
} else {
180+
url.pagepath[1] = "stdlib"
181+
}
182+
| _ => ()
179183
}
180184

181185
let targetUrl =

0 commit comments

Comments
 (0)