mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed search on 404 pages
This commit is contained in:
parent
29ad8177fe
commit
c98e2d39c7
@ -26,6 +26,7 @@ import {
|
|||||||
map,
|
map,
|
||||||
pluck,
|
pluck,
|
||||||
shareReplay,
|
shareReplay,
|
||||||
|
switchMap,
|
||||||
take,
|
take,
|
||||||
withLatestFrom
|
withLatestFrom
|
||||||
} from "rxjs/operators"
|
} from "rxjs/operators"
|
||||||
@ -117,13 +118,16 @@ export function setupSearchWorker(
|
|||||||
/* Fetch index if it wasn't passed explicitly */
|
/* Fetch index if it wasn't passed explicitly */
|
||||||
const index$ = typeof index !== "undefined"
|
const index$ = typeof index !== "undefined"
|
||||||
? from(index)
|
? from(index)
|
||||||
: ajax({
|
: origin$
|
||||||
url: `${base}/search/search_index.json`,
|
.pipe(
|
||||||
|
switchMap(origin => ajax({
|
||||||
|
url: `${origin}/search/search_index.json`,
|
||||||
responseType: "json",
|
responseType: "json",
|
||||||
withCredentials: true
|
withCredentials: true
|
||||||
})
|
})
|
||||||
.pipe<SearchIndexOptions>(
|
.pipe<SearchIndexOptions>(
|
||||||
pluck("response")
|
pluck("response")
|
||||||
|
))
|
||||||
)
|
)
|
||||||
|
|
||||||
/* Send index to worker */
|
/* Send index to worker */
|
||||||
|
Loading…
Reference in New Issue
Block a user