From f7bb44baaea5103c6c73a2cd06cc301dde47870b Mon Sep 17 00:00:00 2001 From: Chris Thoburn Date: Thu, 12 Sep 2024 04:38:28 +0100 Subject: [PATCH] 20 - DEMO5 ImageWorker makes it nice --- app/components/pokemon-grid-item.gts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/components/pokemon-grid-item.gts b/app/components/pokemon-grid-item.gts index e63fc28..2235611 100644 --- a/app/components/pokemon-grid-item.gts +++ b/app/components/pokemon-grid-item.gts @@ -48,12 +48,11 @@ export default class PokemonGridItem extends Component { @cached get thumbnailUrl() { - return this.args.pokemon.image.thumbnail; - // const state = getPromiseState(this.thumbnailRequest); - // if (state.isError || state.isPending) { - // return null; - // } - // return state.result; + const state = getPromiseState(this.thumbnailRequest); + if (state.isError || state.isPending) { + return null; + } + return state.result; }