From 6918b3cefa3a328c3ebfbba4ea1fbb9972dc063a Mon Sep 17 00:00:00 2001 From: Matchu Date: Mon, 26 Apr 2021 06:07:52 -0700 Subject: [PATCH] Fix bulk-add layers tool Oops, we extracted Support fields out from the default `appearanceLayerFragment`! This was causing the page to silently fail to show any changes, because `layer.remoteId` was evaluating to `undefined` rather than one of the ID numbers in the range. Here, I've added both `remoteId` explictly because we use it directly, and also the support fields because that's what the layer support UI needs! --- src/app/WardrobePage/support/AllItemLayersSupportModal.js | 4 ++++ src/app/components/useOutfitAppearance.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/WardrobePage/support/AllItemLayersSupportModal.js b/src/app/WardrobePage/support/AllItemLayersSupportModal.js index f585b8b..e5565fa 100644 --- a/src/app/WardrobePage/support/AllItemLayersSupportModal.js +++ b/src/app/WardrobePage/support/AllItemLayersSupportModal.js @@ -19,6 +19,7 @@ import { import { gql, useMutation, useQuery } from "@apollo/client"; import { appearanceLayerFragment, + appearanceLayerFragmentForSupport, itemAppearanceFragment, petAppearanceFragment, } from "../../components/useOutfitAppearance"; @@ -246,7 +247,9 @@ function AllItemLayersSupportModalContent({ remoteIds: $layerRemoteIds ) { id + remoteId ...AppearanceLayerForOutfitPreview + ...AppearanceLayerForSupport } color(id: $colorId) { @@ -281,6 +284,7 @@ function AllItemLayersSupportModalContent({ } ${appearanceLayerFragment} + ${appearanceLayerFragmentForSupport} ${petAppearanceFragment} `, { diff --git a/src/app/components/useOutfitAppearance.js b/src/app/components/useOutfitAppearance.js index 8ccbf1d..7214589 100644 --- a/src/app/components/useOutfitAppearance.js +++ b/src/app/components/useOutfitAppearance.js @@ -226,7 +226,7 @@ export const appearanceLayerFragment = gql` } `; -const appearanceLayerFragmentForSupport = gql` +export const appearanceLayerFragmentForSupport = gql` fragment AppearanceLayerForSupport on AppearanceLayer { id remoteId # HACK: This is for Support tools, but other views don't need it