From cadfb59b8d145951b751b0644025e58c39e73c06 Mon Sep 17 00:00:00 2001 From: Dmitry Popov Date: Sun, 16 Mar 2025 20:49:58 +0100 Subject: [PATCH] fix(Core): fixed lazy delete reset state --- .../SystemSignaturesContent/SystemSignaturesContent.tsx | 5 ++++- .../widgets/SystemSignatures/hooks/usePendingDeletions.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemSignatures/SystemSignaturesContent/SystemSignaturesContent.tsx b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemSignatures/SystemSignaturesContent/SystemSignaturesContent.tsx index 337728c7..fbf67684 100644 --- a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemSignatures/SystemSignaturesContent/SystemSignaturesContent.tsx +++ b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemSignatures/SystemSignaturesContent/SystemSignaturesContent.tsx @@ -57,7 +57,10 @@ interface SystemSignaturesContentProps { onSelect?: (signature: SystemSignature) => void; onLazyDeleteChange?: (value: boolean) => void; onCountChange?: (count: number) => void; - onPendingChange?: (pending: ExtendedSystemSignature[], undo: () => void) => void; + onPendingChange?: ( + pending: React.MutableRefObject>, + undo: () => void, + ) => void; deletionTiming?: number; filterSignature?: (signature: SystemSignature) => boolean; } diff --git a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemSignatures/hooks/usePendingDeletions.ts b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemSignatures/hooks/usePendingDeletions.ts index 2591e084..89f9a51b 100644 --- a/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemSignatures/hooks/usePendingDeletions.ts +++ b/assets/js/hooks/Mapper/components/mapInterface/widgets/SystemSignatures/hooks/usePendingDeletions.ts @@ -70,6 +70,7 @@ export function usePendingDeletions({ }); delete pendingDeletionMapRef.current[sig.eve_id]; setSignatures(prev => prev.filter(x => x.eve_id !== sig.eve_id)); + onPendingChange?.(pendingDeletionMapRef, clearPendingDeletions); }, finalDuration, );