From e076c8448326c895b65d549c7bd4e255bd989880 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Wed, 16 Mar 2022 11:20:53 -0500 Subject: [PATCH] Fix buyables not supporting CoercableComponents for displays --- src/features/buyable.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/features/buyable.tsx b/src/features/buyable.tsx index ad684cb..a2d58af 100644 --- a/src/features/buyable.tsx +++ b/src/features/buyable.tsx @@ -162,12 +162,10 @@ export function createBuyable( buyable.display = jsx(() => { // TODO once processComputable types correctly, remove this "as X" const currDisplay = unref(display) as BuyableDisplay; - if ( - currDisplay != null && - !isCoercableComponent(currDisplay) && - buyable.cost != null && - buyable.resource != null - ) { + if (isCoercableComponent(currDisplay)) { + return ; + } + if (currDisplay != null && buyable.cost != null && buyable.resource != null) { const genericBuyable = buyable as GenericBuyable; const Title = coerceComponent(currDisplay.title || "", "h3"); const Description = coerceComponent(currDisplay.description);