mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-08-04 19:45:08 -04:00
Fixed handling of 4xx status codes when using instant loading
This commit is contained in:
@@ -22,7 +22,9 @@
|
||||
|
||||
import { Repo, User } from "github-types"
|
||||
import {
|
||||
EMPTY,
|
||||
Observable,
|
||||
catchError,
|
||||
defaultIfEmpty,
|
||||
map,
|
||||
zip
|
||||
@@ -65,6 +67,7 @@ export function fetchSourceFactsFromGitHub(
|
||||
/* Fetch version */
|
||||
requestJSON<Release>(`${url}/releases/latest`)
|
||||
.pipe(
|
||||
catchError(() => EMPTY), // @todo refactor instant loading
|
||||
map(release => ({
|
||||
version: release.tag_name
|
||||
})),
|
||||
@@ -74,6 +77,7 @@ export function fetchSourceFactsFromGitHub(
|
||||
/* Fetch stars and forks */
|
||||
requestJSON<Repo>(url)
|
||||
.pipe(
|
||||
catchError(() => EMPTY), // @todo refactor instant loading
|
||||
map(info => ({
|
||||
stars: info.stargazers_count,
|
||||
forks: info.forks_count
|
||||
|
||||
Reference in New Issue
Block a user