diff --git a/apps/ssb.json b/apps/ssb.json index 67cb89a4..8c4553ab 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🦀", - "previous": "&Do4vIjdE5vJgJ+fIZ10zOeDQcqNd+VUacQl2wzRjGhw=.sha256" + "previous": "&8uDmJfrjfiVcvxJlkYli5PqLnO8Xje/1qDVtzAXA7A4=.sha256" } diff --git a/apps/ssb/tf-tab-search.js b/apps/ssb/tf-tab-search.js index 91bfad26..96113cf1 100644 --- a/apps/ssb/tf-tab-search.js +++ b/apps/ssb/tf-tab-search.js @@ -1,4 +1,4 @@ -import {LitElement, html, unsafeHTML} from './lit-all.min.js'; +import {LitElement, html, unsafeHTML, until} from './lit-all.min.js'; import * as tfrpc from '/static/tfrpc.js'; import {styles, generate_theme} from './tf-styles.js'; @@ -133,17 +133,25 @@ class TfTabSearchElement extends LitElement { } } - render() { + async query_results() { if (this.query !== this.last_query) { this.last_query = this.query; - this.search(this.query); + this._query = this.search(this.query); } - let self = this; + await this._query; + } + + render() { return html` -
${this.render_results()}
+
+ ${until( + this.query_results().then(this.render_results.bind(this)), + html`

Searching...🦀

` + )} +
`; } }