From f48aa23fcdbd06300315456729d697b69f858130 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 20 Jan 2018 21:06:30 -0800 Subject: [PATCH] improve perf of loading avatars --- routes/_components/Avatar.html | 32 +++++++++++++++----------------- routes/_components/Layout.html | 6 +++--- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/routes/_components/Avatar.html b/routes/_components/Avatar.html index d155a55..13c4458 100644 --- a/routes/_components/Avatar.html +++ b/routes/_components/Avatar.html @@ -1,15 +1,11 @@ -{{#await imagePromise}} - -{{then src}} - -{{catch error}} +{{#if error}} -{{/await}} - +{{else}} + +{{/if}} \ No newline at end of file diff --git a/routes/_components/Layout.html b/routes/_components/Layout.html index ce524aa..59ea249 100644 --- a/routes/_components/Layout.html +++ b/routes/_components/Layout.html @@ -52,13 +52,13 @@ leading: true, trailing: true }) - node.addEventListener('scroll', onScroll); + node.addEventListener('scroll', onScroll) return { teardown() { - node.removeEventListener('scroll', onScroll); + node.removeEventListener('scroll', onScroll) } - }; + } }, fullscreen(node, callback) { const onFullscreen = (() => {