fix(trash): warn about unsaved edits when delete asks nothing
With askBeforeDelete off, clicking ✕ on the entry being edited trashed it and closed the editor with no prompt whatsoever — a misclick cost the edits silently. That path now runs the discard gate (no-op unless dirty). When askBeforeDelete is on, its own confirm still stands alone: one modal. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -5286,6 +5286,12 @@ async function deleteEntry(id) {
|
||||
danger: true,
|
||||
});
|
||||
if (!ok) return;
|
||||
} else if (soState && soState.id === id) {
|
||||
// No delete confirmation configured: a misclick on ✕ would trash the
|
||||
// entry AND drop the edits in the open editor with no warning at all.
|
||||
// The discard gate stands in for it (it no-ops when nothing is dirty).
|
||||
// Skipped when askBeforeDelete already asked — one modal is enough.
|
||||
if (!(await requestCloseSlideOver())) return;
|
||||
}
|
||||
try {
|
||||
await api('/entries/' + id, { method: 'DELETE', headers: authHeaders() });
|
||||
|
||||
Reference in New Issue
Block a user