From dc6d5b5851915faa7cdd0a0a336b77280117af10 Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 22 Apr 2021 01:59:49 -0700 Subject: [PATCH] Minor variable name change --- src/app/WardrobePage/ItemsPanel.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/WardrobePage/ItemsPanel.js b/src/app/WardrobePage/ItemsPanel.js index 95026d4..430d587 100644 --- a/src/app/WardrobePage/ItemsPanel.js +++ b/src/app/WardrobePage/ItemsPanel.js @@ -255,15 +255,16 @@ function useOutfitSaving(outfitState) { const history = useHistory(); const toast = useToast(); - const isSaved = Boolean(outfitState.id); + // Whether this outfit has *ever* been saved, vs a brand-new local outfit. + const hasBeenSaved = 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) && + (!hasBeenSaved || outfitState.creator?.id === currentUserId) && // TODO: Add support for updating outfits - !isSaved; + !hasBeenSaved; const [sendSaveOutfitMutation, { loading: isSaving }] = useMutation( gql`