Fix crash when choosing invalid appearance

Oops, I messed up in my `useOutfitPreview` refactor just now! Fixing fixing!
This commit is contained in:
Emi Matchu 2021-02-09 22:27:22 -08:00
parent c0e1c78d75
commit 1eb00ba6ca

View file

@ -77,8 +77,9 @@ export function useOutfitPreview({
}
}, [layersHaveAnimations, onChangeHasAnimations]);
let preview;
if (error || error2) {
return (
preview = (
<FullScreenCenter>
<Text color="green.50" d="flex" alignItems="center">
<WarningIcon />
@ -87,9 +88,8 @@ export function useOutfitPreview({
</Text>
</FullScreenCenter>
);
}
const preview = (
} else {
preview = (
<OutfitLayers
loading={isLoading || loading || loading2}
visibleLayers={loadedLayers}
@ -102,6 +102,7 @@ export function useOutfitPreview({
isPaused={isPaused}
/>
);
}
return { appearance, preview };
}