mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-08-04 11:35:17 -04:00
Improved graceful handling of broken search when browsing locally
This commit is contained in:
@@ -20,8 +20,9 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { Observable, from } from "rxjs"
|
||||
import { EMPTY, Observable, from } from "rxjs"
|
||||
import {
|
||||
catchError,
|
||||
filter,
|
||||
map,
|
||||
shareReplay,
|
||||
@@ -35,6 +36,9 @@ import {
|
||||
/**
|
||||
* Fetch the given URL
|
||||
*
|
||||
* If the request fails (e.g. when dispatched from `file://` locations), the
|
||||
* observable will complete without emitting a value.
|
||||
*
|
||||
* @param url - Request URL
|
||||
* @param options - Options
|
||||
*
|
||||
@@ -46,6 +50,7 @@ export function request(
|
||||
return from(fetch(`${url}`, options))
|
||||
.pipe(
|
||||
filter(res => res.status === 200),
|
||||
catchError(() => EMPTY)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user