Fixed #2703: search remains at 'Initializing search' on mobile

This commit is contained in:
squidfunk 2021-05-27 11:36:08 +02:00
parent bcbe24224c
commit 409d151044
8 changed files with 26 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -39,7 +39,7 @@
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block styles %} {% block styles %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.10e03543.min.css' | url }}"> <link rel="stylesheet" href="{{ 'assets/stylesheets/main.66ec5ba4.min.css' | url }}">
{% if config.theme.palette %} {% if config.theme.palette %}
{% set palette = config.theme.palette %} {% set palette = config.theme.palette %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.f1a3b89f.min.css' | url }}"> <link rel="stylesheet" href="{{ 'assets/stylesheets/palette.f1a3b89f.min.css' | url }}">
@ -223,7 +223,7 @@
</script> </script>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script src="{{ 'assets/javascripts/bundle.a6b08407.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/bundle.70ffd0a1.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %} {% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script> <script src="{{ path | url }}"></script>
{% endfor %} {% endfor %}

View File

@ -35,6 +35,7 @@ import {
observeOn, observeOn,
startWith, startWith,
switchMap, switchMap,
take,
tap, tap,
withLatestFrom, withLatestFrom,
zipWith zipWith
@ -53,6 +54,7 @@ import {
import { import {
SearchResult as SearchResultData, SearchResult as SearchResultData,
SearchWorker, SearchWorker,
isSearchReadyMessage,
isSearchResultMessage isSearchResultMessage
} from "~/integrations" } from "~/integrations"
import { renderSearchResult } from "~/templates" import { renderSearchResult } from "~/templates"
@ -107,8 +109,21 @@ export function mountSearchResult(
filter(Boolean) filter(Boolean)
) )
/* Update search result metadata */ /* Retrieve nested components */
const meta = getElementOrThrow(":scope > :first-child", el) const meta = getElementOrThrow(":scope > :first-child", el)
const list = getElementOrThrow(":scope > :last-child", el)
/* Update search result metadata when ready */
rx$
.pipe(
filter(isSearchReadyMessage),
take(1)
)
.subscribe(() => {
resetSearchResultMeta(meta)
})
/* Update search result metadata */
internal$ internal$
.pipe( .pipe(
observeOn(animationFrameScheduler), observeOn(animationFrameScheduler),
@ -122,7 +137,6 @@ export function mountSearchResult(
}) })
/* Update search result list */ /* Update search result list */
const list = getElementOrThrow(":scope > :last-child", el)
internal$ internal$
.pipe( .pipe(
observeOn(animationFrameScheduler), observeOn(animationFrameScheduler),