Fix crash when choosing invalid appearance
Oops, I messed up in my `useOutfitPreview` refactor just now! Fixing fixing!
This commit is contained in:
parent
c0e1c78d75
commit
1eb00ba6ca
1 changed files with 16 additions and 15 deletions
|
@ -77,8 +77,9 @@ export function useOutfitPreview({
|
||||||
}
|
}
|
||||||
}, [layersHaveAnimations, onChangeHasAnimations]);
|
}, [layersHaveAnimations, onChangeHasAnimations]);
|
||||||
|
|
||||||
|
let preview;
|
||||||
if (error || error2) {
|
if (error || error2) {
|
||||||
return (
|
preview = (
|
||||||
<FullScreenCenter>
|
<FullScreenCenter>
|
||||||
<Text color="green.50" d="flex" alignItems="center">
|
<Text color="green.50" d="flex" alignItems="center">
|
||||||
<WarningIcon />
|
<WarningIcon />
|
||||||
|
@ -87,22 +88,22 @@ export function useOutfitPreview({
|
||||||
</Text>
|
</Text>
|
||||||
</FullScreenCenter>
|
</FullScreenCenter>
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
preview = (
|
||||||
|
<OutfitLayers
|
||||||
|
loading={isLoading || loading || loading2}
|
||||||
|
visibleLayers={loadedLayers}
|
||||||
|
placeholder={placeholder}
|
||||||
|
backdrop={backdrop}
|
||||||
|
loadingDelayMs={loadingDelayMs}
|
||||||
|
spinnerVariant={spinnerVariant}
|
||||||
|
onChangeHasAnimations={onChangeHasAnimations}
|
||||||
|
doTransitions
|
||||||
|
isPaused={isPaused}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const preview = (
|
|
||||||
<OutfitLayers
|
|
||||||
loading={isLoading || loading || loading2}
|
|
||||||
visibleLayers={loadedLayers}
|
|
||||||
placeholder={placeholder}
|
|
||||||
backdrop={backdrop}
|
|
||||||
loadingDelayMs={loadingDelayMs}
|
|
||||||
spinnerVariant={spinnerVariant}
|
|
||||||
onChangeHasAnimations={onChangeHasAnimations}
|
|
||||||
doTransitions
|
|
||||||
isPaused={isPaused}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
|
||||||
return { appearance, preview };
|
return { appearance, preview };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue