Don't save the outfit while it's already saving

It's weird to be reading this code and be like. was this not always an
issue? Maybe something in Apollo prevented this? Did we use optimistic
UI or something? Idk?

There's still an issue with it infinitely retrying in an error state
though.
This commit is contained in:
Emi Matchu 2023-11-06 12:38:38 -08:00
parent 18ff22f211
commit f8bcf5a0de

View file

@ -130,6 +130,7 @@ function useOutfitSaving(outfitState, dispatchToOutfit) {
if (
!isNewOutfit &&
canSaveOutfit &&
!isSaving &&
debouncedOutfitStateIsSaveable &&
!outfitStatesAreEqual(debouncedOutfitState, outfitState.savedOutfitState)
) {
@ -143,6 +144,7 @@ function useOutfitSaving(outfitState, dispatchToOutfit) {
}, [
isNewOutfit,
canSaveOutfit,
isSaving,
debouncedOutfitState,
debouncedOutfitStateIsSaveable,
outfitState.savedOutfitState,