From 5d6b26799207f54809ac5500e180bf7310611fec Mon Sep 17 00:00:00 2001 From: Matt Dunn-Rankin Date: Sun, 3 May 2020 01:08:43 -0700 Subject: [PATCH] fix outfit resets for emotion/gp --- src/app/OutfitResetModal.js | 2 ++ src/app/useOutfitState.js | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/OutfitResetModal.js b/src/app/OutfitResetModal.js index 0e16fd5..6e8508d 100644 --- a/src/app/OutfitResetModal.js +++ b/src/app/OutfitResetModal.js @@ -55,6 +55,8 @@ function OutfitResetModal({ isOpen, onClose, dispatchToOutfit }) { name: petName, speciesId: species.id, colorId: color.id, + emotion: "HAPPY", // TODO: Ask PetService + genderPresentation: "FEMININE", // TODO: Ask PetService wornItemIds: items.map((i) => i.id), closetedItemIds: [], }); diff --git a/src/app/useOutfitState.js b/src/app/useOutfitState.js index b5d87ec..7388b25 100644 --- a/src/app/useOutfitState.js +++ b/src/app/useOutfitState.js @@ -202,8 +202,9 @@ const outfitStateReducer = (apolloClient) => (baseState, action) => { state.name = name; state.speciesId = speciesId ? String(speciesId) : baseState.speciesId; state.colorId = colorId ? String(colorId) : baseState.colorId; - state.emotion = emotion; - state.genderPresentation = genderPresentation; + state.emotion = emotion || baseState.emotion; + state.genderPresentation = + genderPresentation || baseState.genderPresentation; state.wornItemIds = wornItemIds ? new Set(wornItemIds.map(String)) : baseState.wornItemIds;