From 7cee5bd066df7dd8d526f6b3c721fa45f78160cb Mon Sep 17 00:00:00 2001 From: duckietm Date: Tue, 17 Mar 2026 11:15:57 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=86=99=20Small=20fix=20for=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../avatar-info/infostand/InfoStandBadgeSlotView.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/room/widgets/avatar-info/infostand/InfoStandBadgeSlotView.tsx b/src/components/room/widgets/avatar-info/infostand/InfoStandBadgeSlotView.tsx index 951df53..6a504d2 100644 --- a/src/components/room/widgets/avatar-info/infostand/InfoStandBadgeSlotView.tsx +++ b/src/components/room/widgets/avatar-info/infostand/InfoStandBadgeSlotView.tsx @@ -1,5 +1,6 @@ import { FC, useCallback, useEffect, useRef, useState } from 'react'; import { FaPlus } from 'react-icons/fa'; +import { LocalizeText } from '../../../../../api'; import { LayoutBadgeImageView } from '../../../../../common'; import { useInventoryBadges } from '../../../../../hooks'; @@ -49,13 +50,13 @@ const BadgeMiniPicker: FC<{ setSearch(e.target.value) } /> { badgeCodes.length === 0 - ? Caricamento... + ? { LocalizeText('generic.loading') } : (
{ filtered.slice(0, 40).map(code => ( @@ -67,7 +68,7 @@ const BadgeMiniPicker: FC<{
)) } { filtered.length === 0 && ( - Nessun badge + { LocalizeText('generic.no_results_found') } ) } ) } @@ -81,8 +82,6 @@ export const InfoStandBadgeSlotView: FC = ({ slotIndex, const [ isDragOver, setIsDragOver ] = useState(false); const [ showPicker, setShowPicker ] = useState(false); - // For own user: use hook data if loaded, otherwise fall back to props (avatarInfo) - // For other users: always use props const hookBadge = activeBadgeCodes.length > 0 ? (activeBadgeCodes[slotIndex] ?? null) : null; const badgeCode = isOwnUser ? (hookBadge ?? badgeCodeFromProps ?? null) : (badgeCodeFromProps ?? null); @@ -117,14 +116,12 @@ export const InfoStandBadgeSlotView: FC = ({ slotIndex, if(sourceSlotStr !== '') { - // Dragged from another infostand slot -> always swap (works with empty slots too) const sourceSlot = parseInt(sourceSlotStr); if(sourceSlot !== slotIndex) swapBadges(sourceSlot, slotIndex); } else { - // Dragged from inventory or external -> place at this slot setBadgeAtSlot(droppedBadgeCode, slotIndex); } }, [ isOwnUser, slotIndex, swapBadges, setBadgeAtSlot ]);