mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 06:40:50 +01:00
Update CatalogGiftView
This commit is contained in:
parent
f65947c8f6
commit
c08e60ba2d
@ -54,8 +54,11 @@ export const CatalogGiftView: FC<{}> = props =>
|
||||
if(giftData.colors && giftData.colors.length > 0) newColors.push({ id: colorId, color: `#${giftData.colors[0].toString(16)}` });
|
||||
}
|
||||
|
||||
setSelectedColorId(newColors[0].id);
|
||||
setColors(newColors);
|
||||
if(newColors.length)
|
||||
{
|
||||
setSelectedColorId(newColors[0].id);
|
||||
setColors(newColors);
|
||||
}
|
||||
}, [ giftConfiguration ]);
|
||||
|
||||
const close = useCallback(() =>
|
||||
@ -68,7 +71,8 @@ export const CatalogGiftView: FC<{}> = props =>
|
||||
setMessage('');
|
||||
setSelectedBoxIndex(0);
|
||||
setSelectedRibbonIndex(0);
|
||||
setSelectedColorId(colors[0].id);
|
||||
|
||||
if(colors.length) setSelectedColorId(colors[0].id);
|
||||
}, [ colors ]);
|
||||
|
||||
const onCatalogEvent = useCallback((event: CatalogEvent) =>
|
||||
|
Loading…
Reference in New Issue
Block a user