+{/if}
diff --git a/src/routes/_components/timeline/Timeline.html b/src/routes/_components/timeline/Timeline.html
index 648aac91..771de45c 100644
--- a/src/routes/_components/timeline/Timeline.html
+++ b/src/routes/_components/timeline/Timeline.html
@@ -4,11 +4,9 @@
on:focusin="saveFocus(event)"
on:focusout="clearFocus()"
>
- {#await componentsPromise}
-
- {:then result}
-
- {:catch error}
- Error: component failed to load! Try reloading. {error}
- {/await}
+ {/if}
@@ -66,6 +62,7 @@
setupTimeline()
this.restoreFocus()
this.setupStreaming()
+ this.setupAsyncComponents()
},
ondestroy () {
console.log('ondestroy')
@@ -75,7 +72,8 @@
LoadingFooter,
MoreHeaderVirtualWrapper,
Status,
- scrollTop: 0
+ scrollTop: 0,
+ components: undefined
}),
computed: {
// For threads, it's simpler to just render all items as a pseudo-virtual list
@@ -230,6 +228,16 @@
teardownFocus () {
window.removeEventListener('pushState', this.onPushState)
},
+ setupAsyncComponents () {
+ this.observe('componentsPromise', async componentsPromise => {
+ if (componentsPromise) {
+ console.log('loading timeline components')
+ const components = await componentsPromise
+ console.log('loaded timeline components')
+ this.set({ components })
+ }
+ })
+ },
onPushState () {
this.store.setForCurrentTimeline({ ignoreBlurEvents: true })
},