From 9f2629ae613bd9443e9b9800f18c5844f9a89b5f Mon Sep 17 00:00:00 2001 From: Matchu Date: Fri, 16 Apr 2021 23:49:10 -0700 Subject: [PATCH] Fix crash when editing saved outfit Oops, something I didn't test in the recent refactor! Right, these need to be Sets. --- src/app/WardrobePage/useOutfitState.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/WardrobePage/useOutfitState.js b/src/app/WardrobePage/useOutfitState.js index 044f25e..7fd2d1d 100644 --- a/src/app/WardrobePage/useOutfitState.js +++ b/src/app/WardrobePage/useOutfitState.js @@ -383,8 +383,10 @@ function getOutfitStateFromOutfitData(outfit) { colorId: outfit.petAppearance?.color?.id, pose: outfit.petAppearance?.pose, // Whereas the items are more convenient to just leave as empty lists! - wornItemIds: (outfit.wornItems || []).map((item) => item.id), - closetedItemIds: (outfit.closetedItems || []).map((item) => item.id), + wornItemIds: new Set((outfit.wornItems || []).map((item) => item.id)), + closetedItemIds: new Set( + (outfit.closetedItems || []).map((item) => item.id) + ), }; }