🆙 Small update

This commit is contained in:
duckietm
2026-04-01 10:23:00 +02:00
parent ef008804d7
commit aa10cb54db
2 changed files with 33 additions and 20 deletions
@@ -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;