From b7b4fa21ec071962eac764f5ea9a8183ddaa9a55 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 17 Jul 2021 05:47:32 -0700 Subject: [PATCH] Oops, show models needed for special colors Right, oops, `speciesThatNeedModels` is for standard colors! Add in the special colors, too! --- src/app/HomePage.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/app/HomePage.js b/src/app/HomePage.js index 50ee7ff..c687068 100644 --- a/src/app/HomePage.js +++ b/src/app/HomePage.js @@ -386,6 +386,18 @@ function NewItemsSectionContent() { id name } + babySpeciesThatNeedModels: speciesThatNeedModels(colorId: "6") { + id + name + } + maraquanSpeciesThatNeedModels: speciesThatNeedModels(colorId: "44") { + id + name + } + mutantSpeciesThatNeedModels: speciesThatNeedModels(colorId: "46") { + id + name + } compatibleBodiesAndTheirZones { body { id @@ -492,10 +504,16 @@ function ItemModelingSummary({ item }) { // NOTE: To test this logic, I like to swap out `newestItems` in the query: // `newestItems: items(ids: ["81546", "35082", "75149", "81797", "58741", "78953", "82427", "82727", "82726"])` - if (item.speciesThatNeedModels.length > 0) { + const numModelsNeeded = + item.speciesThatNeedModels.length + + item.babySpeciesThatNeedModels.length + + item.maraquanSpeciesThatNeedModels.length + + item.mutantSpeciesThatNeedModels.length; + + if (numModelsNeeded > 0) { return ( - Need {item.speciesThatNeedModels.length} models + Need {numModelsNeeded} models ); }