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(() => {
|
buyable.display = jsx(() => {
|
||||||
// TODO once processComputable types correctly, remove this "as X"
|
// TODO once processComputable types correctly, remove this "as X"
|
||||||
const currDisplay = unref(display) as BuyableDisplay;
|
const currDisplay = unref(display) as BuyableDisplay;
|
||||||
if (
|
if (isCoercableComponent(currDisplay)) {
|
||||||
currDisplay != null &&
|
return <currDisplay />;
|
||||||
!isCoercableComponent(currDisplay) &&
|
}
|
||||||
buyable.cost != null &&
|
if (currDisplay != null && buyable.cost != null && buyable.resource != null) {
|
||||||
buyable.resource != null
|
|
||||||
) {
|
|
||||||
const genericBuyable = buyable as GenericBuyable;
|
const genericBuyable = buyable as GenericBuyable;
|
||||||
const Title = coerceComponent(currDisplay.title || "", "h3");
|
const Title = coerceComponent(currDisplay.title || "", "h3");
|
||||||
const Description = coerceComponent(currDisplay.description);
|
const Description = coerceComponent(currDisplay.description);
|
||||||
|
|
Loading…
Reference in a new issue