Skip to content

Commit

Permalink
Improved graceful handling of broken search when browsing locally
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Oct 3, 2021
1 parent 149b0db commit 88ed401
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 32 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ <h1>{{ page.title | d(config.site_name, true)}}</h1>
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.c7d1b464.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.cfdd7908.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script>
{% endfor %}
Expand Down
18 changes: 0 additions & 18 deletions material/overrides/assets/javascripts/bundle.54f85274.min.js

This file was deleted.

18 changes: 18 additions & 0 deletions material/overrides/assets/javascripts/bundle.602c421d.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="{{ 'overrides/assets/javascripts/bundle.54f85274.min.js' | url }}"></script>
<script src="{{ 'overrides/assets/javascripts/bundle.602c421d.min.js' | url }}"></script>
{% endblock %}
7 changes: 6 additions & 1 deletion src/assets/javascripts/browser/request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
* IN THE SOFTWARE.
*/

import { Observable, from } from "rxjs"
import { EMPTY, Observable, from } from "rxjs"
import {
catchError,
filter,
map,
shareReplay,
Expand All @@ -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
*
Expand All @@ -46,6 +50,7 @@ export function request(
return from(fetch(`${url}`, options))
.pipe(
filter(res => res.status === 200),
catchError(() => EMPTY)
)
}

Expand Down

0 comments on commit 88ed401

Please sign in to comment.