From 939a45d5e8777f97b525b40b2dce4811c519f80f Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Wed, 10 Mar 2021 08:19:02 +0100 Subject: [PATCH] some recipe preview fixes --- app/js/components/item-preview.js | 11 ++++++++++- app/js/components/recipe-info.js | 22 ++++++++-------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/app/js/components/item-preview.js b/app/js/components/item-preview.js index 502b6a5..99a9c65 100644 --- a/app/js/components/item-preview.js +++ b/app/js/components/item-preview.js @@ -7,6 +7,9 @@ Vue.component("item-preview", { }, computed: { previewType: function(){ + if (!this.item){ + return "unknown"; + } if (this.item.inventory_image){ return "invimage"; } @@ -18,12 +21,18 @@ Vue.component("item-preview", { case "plantlike": return "invimage"; default: return "invimage"; } + }, + isGroup: function(){ + return this.item && /^group:/.test(this.item.name); } }, template: /*html*/` +
+ ? +
diff --git a/app/js/components/recipe-info.js b/app/js/components/recipe-info.js index eb7acd5..2f3d319 100644 --- a/app/js/components/recipe-info.js +++ b/app/js/components/recipe-info.js @@ -39,7 +39,7 @@ Vue.component("recipe-info-smelting", { template: /*html*/`