mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 23:16:21 +00:00
🆙 Small update
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { NitroEventType } from '@nitrots/nitro-renderer';
|
||||
import { FC, useEffect, useState } from 'react';
|
||||
import { AvatarEditorThumbnailsHelper, GetClubMemberLevel, GetConfigurationValue, IAvatarEditorCategoryPartItem } from '../../../api';
|
||||
import { LayoutCurrencyIcon, LayoutGridItemProps } from '../../../common';
|
||||
import { useAvatarEditor } from '../../../hooks';
|
||||
import { useNitroEvent } from '../../../hooks/events';
|
||||
import { InfiniteGrid } from '../../../layout';
|
||||
import { AvatarEditorIcon } from '../AvatarEditorIcon';
|
||||
|
||||
@@ -14,6 +16,7 @@ export const AvatarEditorFigureSetItemView: FC<{
|
||||
{
|
||||
const { setType = null, partItem = null, isSelected = false, width = '100%', ...rest } = props;
|
||||
const [ assetUrl, setAssetUrl ] = useState<string>('');
|
||||
const [ retryId, setRetryId ] = useState<number>(0);
|
||||
const { selectedColorParts = null, getFigureStringWithFace = null } = useAvatarEditor();
|
||||
|
||||
const clubLevel = partItem.partSet?.clubLevel ?? 0;
|
||||
@@ -21,6 +24,11 @@ export const AvatarEditorFigureSetItemView: FC<{
|
||||
const isLocked = isHC && (GetClubMemberLevel() < clubLevel);
|
||||
const isSellableNotOwned = partItem.isSellableNotOwned ?? false;
|
||||
|
||||
useNitroEvent(NitroEventType.AVATAR_ASSET_LOADED, () =>
|
||||
{
|
||||
if(!assetUrl || !assetUrl.length) setRetryId(prev => prev + 1);
|
||||
});
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
setAssetUrl('');
|
||||
@@ -54,7 +62,7 @@ export const AvatarEditorFigureSetItemView: FC<{
|
||||
};
|
||||
|
||||
loadImage();
|
||||
}, [ setType, partItem, selectedColorParts, getFigureStringWithFace, isSellableNotOwned ]);
|
||||
}, [ setType, partItem, selectedColorParts, getFigureStringWithFace, isSellableNotOwned, retryId ]);
|
||||
|
||||
if(!partItem) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user