diff --git a/js/app.js b/js/app.js index 3e7c970..889df62 100644 --- a/js/app.js +++ b/js/app.js @@ -5290,7 +5290,11 @@ async function deleteEntry(id) { try { await api('/entries/' + id, { method: 'DELETE', headers: authHeaders() }); toast('Moved to trash'); - closeSlideOver(); + // Close the editor ONLY when it holds the entry being trashed. Deleting + // some other row used to close it unconditionally, silently dropping + // unsaved edits (no discard prompt — this path bypasses + // requestCloseSlideOver by design: the entry is gone either way). + if (soState && soState.id === id) closeSlideOver(); state.checked.delete(id); await loadEntries(); state.trashedCount = (state.trashedCount || 0) + 1;