Skip to content

Commit

Permalink
Fixed #2703: search remains at 'Initializing search' on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed May 27, 2021
1 parent bcbe242 commit 409d151
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 12 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions material/assets/stylesheets/main.10e03543.min.css

This file was deleted.

1 change: 0 additions & 1 deletion material/assets/stylesheets/main.10e03543.min.css.map

This file was deleted.

2 changes: 2 additions & 0 deletions material/assets/stylesheets/main.66ec5ba4.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions material/assets/stylesheets/main.66ec5ba4.min.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions material/base.html
Expand Up @@ -39,7 +39,7 @@
{% endif %}
{% endblock %}
{% 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 %}
{% set palette = config.theme.palette %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.f1a3b89f.min.css' | url }}">
Expand Down Expand Up @@ -223,7 +223,7 @@ <h1>{{ page.title | d(config.site_name, true)}}</h1>
</script>
{% endblock %}
{% 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"] %}
<script src="{{ path | url }}"></script>
{% endfor %}
Expand Down
18 changes: 16 additions & 2 deletions src/assets/javascripts/components/search/result/index.ts
Expand Up @@ -35,6 +35,7 @@ import {
observeOn,
startWith,
switchMap,
take,
tap,
withLatestFrom,
zipWith
Expand All @@ -53,6 +54,7 @@ import {
import {
SearchResult as SearchResultData,
SearchWorker,
isSearchReadyMessage,
isSearchResultMessage
} from "~/integrations"
import { renderSearchResult } from "~/templates"
Expand Down Expand Up @@ -107,8 +109,21 @@ export function mountSearchResult(
filter(Boolean)
)

/* Update search result metadata */
/* Retrieve nested components */
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$
.pipe(
observeOn(animationFrameScheduler),
Expand All @@ -122,7 +137,6 @@ export function mountSearchResult(
})

/* Update search result list */
const list = getElementOrThrow(":scope > :last-child", el)
internal$
.pipe(
observeOn(animationFrameScheduler),
Expand Down

0 comments on commit 409d151

Please sign in to comment.