Fix buyables not supporting CoercableComponents for displays
This commit is contained in:
parent
31f431af83
commit
e076c84483
1 changed files with 4 additions and 6 deletions
|
@ -162,12 +162,10 @@ export function createBuyable<T extends BuyableOptions>(
|
|||
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 <currDisplay />;
|
||||
}
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue