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
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
intervalRef.current = window.setInterval(() => {

View File

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