diff --git a/src/routes/_components/Nav.html b/src/routes/_components/Nav.html index cc470960..352896f0 100644 --- a/src/routes/_components/Nav.html +++ b/src/routes/_components/Nav.html @@ -13,13 +13,9 @@ {/each} -{#await importNavShortcuts} - -{:then component} - -{:catch error} - -{/await} +{#if navShortcuts} + +{/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 }) },