mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-21 23:50:45 +00:00
fix(scripts): harden delete handler against stale vault state
Read snippets/hosts from refs in the shared delete listener so rapid confirms cannot resurrect already-removed items, and clear pending bulk delete when the scripts panel hides so the confirm dialog does not resurface after a mid-prompt hide. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
This commit is contained in:
4 files changed
+33
-2
No files matched your search
@@ -92,6 +92,15 @@ test("scripts side panel confirms bulk delete and routes it through the shared d
|
||||
);
|
||||
});
|
||||
|
||||
test("scripts side panel clears pending bulk delete when the panel hides", () => {
|
||||
// Returning null while isVisible is false unmounts the confirm dialog; drop
|
||||
// pending deletes so a later re-show does not resurrect a half-dismissed prompt.
|
||||
assert.match(
|
||||
source,
|
||||
/if\s*\(\s*!isVisible\s*\)\s*setPendingDeleteIds\(\s*null\s*\)/,
|
||||
);
|
||||
});
|
||||
|
||||
test("scripts side panel package dialog traps focus and exposes dialog close contract", () => {
|
||||
assert.match(source, /packageDialogRef/);
|
||||
assert.match(source, /data-dialog-close="true"/);
|
||||
|
||||
Reference in new issue
Block a user