mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-12 02:35:42 +00:00
fix: remove bug with lazy delete
This commit is contained in:
@@ -62,8 +62,11 @@ function useSignatureUndo(
|
|||||||
|
|
||||||
// determine timeout from settings
|
// determine timeout from settings
|
||||||
const timeoutMs = getDeletionTimeoutMs(settings);
|
const timeoutMs = getDeletionTimeoutMs(settings);
|
||||||
|
|
||||||
|
// Ensure a minimum of 1 second for immediate deletion so the UI shows
|
||||||
|
const effectiveTimeoutMs = timeoutMs === 0 ? 1000 : timeoutMs;
|
||||||
|
|
||||||
setCountdown(Math.ceil(timeoutMs / 1000));
|
setCountdown(Math.ceil(effectiveTimeoutMs / 1000));
|
||||||
|
|
||||||
// start new interval
|
// start new interval
|
||||||
intervalRef.current = window.setInterval(() => {
|
intervalRef.current = window.setInterval(() => {
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user