Fixed handling of 4xx status codes when using instant loading

This commit is contained in:
squidfunk
2022-05-07 09:22:05 +02:00
parent 684acdcc78
commit 8beda2bfe1
14 changed files with 81 additions and 63 deletions

View File

@@ -21,7 +21,9 @@
*/
import {
EMPTY,
Observable,
catchError,
defaultIfEmpty,
map,
of,
@@ -97,6 +99,7 @@ export function fetchSitemap(base?: URL): Observable<Sitemap> {
map(sitemap => preprocess(getElements("loc", sitemap)
.map(node => node.textContent!)
)),
catchError(() => EMPTY), // @todo refactor instant loading
defaultIfEmpty([]),
tap(sitemap => __md_set("__sitemap", sitemap, sessionStorage, base))
)

View File

@@ -23,6 +23,7 @@
import {
EMPTY,
Subject,
catchError,
combineLatest,
filter,
fromEvent,
@@ -73,6 +74,9 @@ export function setupVersionSelector(
const versions$ = requestJSON<Version[]>(
new URL("../versions.json", config.base)
)
.pipe(
catchError(() => EMPTY) // @todo refactor instant loading
)
/* Determine current version */
const current$ = versions$