mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-19 05:46:27 +01:00
Fix CatalogLayoutPetView
This commit is contained in:
parent
0773bcf044
commit
a3fc343418
@ -26,7 +26,7 @@ export const CatalogLayoutPetView: FC<CatalogLayoutProps> = props =>
|
|||||||
const [ approvalPending, setApprovalPending ] = useState(true);
|
const [ approvalPending, setApprovalPending ] = useState(true);
|
||||||
const [ approvalResult, setApprovalResult ] = useState(-1);
|
const [ approvalResult, setApprovalResult ] = useState(-1);
|
||||||
const { currentOffer = null, setCurrentOffer = null, setPurchaseOptions = null, catalogOptions = null, roomPreviewer = null } = useCatalogContext();
|
const { currentOffer = null, setCurrentOffer = null, setPurchaseOptions = null, catalogOptions = null, roomPreviewer = null } = useCatalogContext();
|
||||||
const { petPalettes = [] } = catalogOptions;
|
const { petPalettes = null } = catalogOptions;
|
||||||
|
|
||||||
const getColor = useMemo(() =>
|
const getColor = useMemo(() =>
|
||||||
{
|
{
|
||||||
@ -138,26 +138,29 @@ export const CatalogLayoutPetView: FC<CatalogLayoutProps> = props =>
|
|||||||
|
|
||||||
if(!productData) return;
|
if(!productData) return;
|
||||||
|
|
||||||
for(const paletteData of petPalettes)
|
if(petPalettes)
|
||||||
{
|
{
|
||||||
if(paletteData.breed !== productData.type) continue;
|
for(const paletteData of petPalettes)
|
||||||
|
|
||||||
const palettes: SellablePetPaletteData[] = [];
|
|
||||||
|
|
||||||
for(const palette of paletteData.palettes)
|
|
||||||
{
|
{
|
||||||
if(!palette.sellable) continue;
|
if(paletteData.breed !== productData.type) continue;
|
||||||
|
|
||||||
palettes.push(palette);
|
const palettes: SellablePetPaletteData[] = [];
|
||||||
|
|
||||||
|
for(const palette of paletteData.palettes)
|
||||||
|
{
|
||||||
|
if(!palette.sellable) continue;
|
||||||
|
|
||||||
|
palettes.push(palette);
|
||||||
|
}
|
||||||
|
|
||||||
|
BatchUpdates(() =>
|
||||||
|
{
|
||||||
|
setSelectedPaletteIndex((palettes.length ? 0 : -1));
|
||||||
|
setSellablePalettes(palettes);
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BatchUpdates(() =>
|
|
||||||
{
|
|
||||||
setSelectedPaletteIndex((palettes.length ? 0 : -1));
|
|
||||||
setSellablePalettes(palettes);
|
|
||||||
});
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BatchUpdates(() =>
|
BatchUpdates(() =>
|
||||||
|
Loading…
Reference in New Issue
Block a user