From 3ab6d1e3ae67f266f6ef0e5eb756ae3a82e66f52 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Thu, 8 Feb 2024 10:15:31 -0800 Subject: [PATCH] Oops, add some more wiring for pet state ID for saved outfits There's an infinite loop happening in prod that I can't reproduce on dev, but this missing piece feels like it could be related. --- app/javascript/wardrobe-2020/WardrobePage/useOutfitSaving.js | 1 + app/javascript/wardrobe-2020/WardrobePage/useOutfitState.js | 1 + app/javascript/wardrobe-2020/loaders/outfits.js | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/javascript/wardrobe-2020/WardrobePage/useOutfitSaving.js b/app/javascript/wardrobe-2020/WardrobePage/useOutfitSaving.js index 9993fe16..07d52f11 100644 --- a/app/javascript/wardrobe-2020/WardrobePage/useOutfitSaving.js +++ b/app/javascript/wardrobe-2020/WardrobePage/useOutfitSaving.js @@ -69,6 +69,7 @@ function useOutfitSaving(outfitState, dispatchToOutfit) { speciesId: outfitState.speciesId, colorId: outfitState.colorId, pose: outfitState.pose, + appearanceId: outfitState.appearanceId, altStyleId: outfitState.altStyleId, wornItemIds: [...outfitState.wornItemIds], closetedItemIds: [...outfitState.closetedItemIds], diff --git a/app/javascript/wardrobe-2020/WardrobePage/useOutfitState.js b/app/javascript/wardrobe-2020/WardrobePage/useOutfitState.js index 0882dd80..f4b78b18 100644 --- a/app/javascript/wardrobe-2020/WardrobePage/useOutfitState.js +++ b/app/javascript/wardrobe-2020/WardrobePage/useOutfitState.js @@ -447,6 +447,7 @@ function getOutfitStateFromOutfitData(outfit) { speciesId: outfit.speciesId, colorId: outfit.colorId, pose: outfit.pose, + appearanceId: outfit.appearanceId, altStyleId: outfit.altStyleId, wornItemIds: new Set(outfit.wornItemIds), closetedItemIds: new Set(outfit.closetedItemIds), diff --git a/app/javascript/wardrobe-2020/loaders/outfits.js b/app/javascript/wardrobe-2020/loaders/outfits.js index 5b3d95ea..b0473ebe 100644 --- a/app/javascript/wardrobe-2020/loaders/outfits.js +++ b/app/javascript/wardrobe-2020/loaders/outfits.js @@ -129,7 +129,7 @@ function normalizeOutfit(outfit) { speciesId: String(outfit.species_id), colorId: String(outfit.color_id), pose: outfit.pose, - appearanceId: outfit.pet_state_id, + appearanceId: String(outfit.pet_state_id), altStyleId: outfit.alt_style_id ? String(outfit.alt_style_id) : null, wornItemIds: (outfit.item_ids?.worn || []).map((id) => String(id)), closetedItemIds: (outfit.item_ids?.closeted || []).map((id) =>