fix: remove bug with lazy delete

This commit is contained in:
guarzo
2025-07-27 08:12:59 -04:00
parent 5347b0060c
commit 48eb7552a9
2 changed files with 7 additions and 9 deletions

View File

@@ -63,7 +63,10 @@ function useSignatureUndo(
// determine timeout from settings // determine timeout from settings
const timeoutMs = getDeletionTimeoutMs(settings); const timeoutMs = getDeletionTimeoutMs(settings);
setCountdown(Math.ceil(timeoutMs / 1000)); // Ensure a minimum of 1 second for immediate deletion so the UI shows
const effectiveTimeoutMs = timeoutMs === 0 ? 1000 : timeoutMs;
setCountdown(Math.ceil(effectiveTimeoutMs / 1000));
// start new interval // start new interval
intervalRef.current = window.setInterval(() => { intervalRef.current = window.setInterval(() => {

View File

@@ -76,15 +76,10 @@ export const useSystemSignaturesData = ({
if (removed.length > 0) { if (removed.length > 0) {
await processRemovedSignatures(removed, added, updated); await processRemovedSignatures(removed, added, updated);
// Only show pending deletions if: // Show pending deletions if lazy deletion is enabled
// 1. Lazy deletion is enabled AND // The deletion timing controls how long the countdown lasts, not whether lazy delete is active
// 2. Deletion timing is not immediate (> 0)
if (onSignatureDeleted && lazyDeleteValue) { if (onSignatureDeleted && lazyDeleteValue) {
const timeoutMs = getDeletionTimeoutMs(settings); onSignatureDeleted(removed);
if (timeoutMs > 0) {
onSignatureDeleted(removed);
}
} }
} }