diff --git a/src/app/WardrobePage/ItemsPanel.js b/src/app/WardrobePage/ItemsPanel.js index ecba292..16d504a 100644 --- a/src/app/WardrobePage/ItemsPanel.js +++ b/src/app/WardrobePage/ItemsPanel.js @@ -255,13 +255,15 @@ function useOutfitSaving(outfitState) { const history = useHistory(); const toast = useToast(); - const isSaved = outfitState.id; + const isSaved = Boolean(outfitState.id); // Only logged-in users can save outfits - and they can only save new outfits, // or outfits they created. const canSaveOutfit = isLoggedIn && (!isSaved || outfitState.creator?.id === currentUserId) && + // TODO: Add support for updating outfits + !isSaved && // TODO: Add support for outfits with items outfitState.wornItemIds.length === 0 && outfitState.closetedItemIds.length === 0; diff --git a/src/app/WardrobePage/useOutfitState.js b/src/app/WardrobePage/useOutfitState.js index 7fd2d1d..7ab1a65 100644 --- a/src/app/WardrobePage/useOutfitState.js +++ b/src/app/WardrobePage/useOutfitState.js @@ -107,7 +107,7 @@ function useOutfitState() { // IDs. It's more convenient to manage them as a Set in state, but most // callers will find it more convenient to access them as arrays! e.g. for // `.map()`. - const { name, speciesId, colorId, pose, appearanceId } = outfitState; + const { id, name, speciesId, colorId, pose, appearanceId } = outfitState; const wornItemIds = Array.from(outfitState.wornItemIds); const closetedItemIds = Array.from(outfitState.closetedItemIds); const allItemIds = [...wornItemIds, ...closetedItemIds]; @@ -218,7 +218,7 @@ function useOutfitState() { const url = buildOutfitUrl(outfitState); const outfitStateWithExtras = { - id: urlOutfitState.outfitId, + id, creator, zonesAndItems, incompatibleItems,