From c7490f5ac9872c2e602e9720a670045774634f7f Mon Sep 17 00:00:00 2001 From: Dionisio Date: Fri, 13 Feb 2026 12:31:47 +0100 Subject: [PATCH] fix: delete confirm dialog never visible + race condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add missing .confirm-dialog.active { display: flex; opacity: 1 } CSS rule. The confirm dialog was created with display:none and the .active class was added, but no CSS rule changed it to visible — so the user never saw the confirmation prompt and delete appeared to do nothing. - Capture file/folder target before closeContextMenu in delete handlers to prevent null reference race condition (same as rename/share fix). --- static/css/style.css | 5 +++++ static/js/contextMenus.js | 20 ++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/static/css/style.css b/static/css/style.css index bf445dd0..674dc995 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -2489,6 +2489,11 @@ select:focus { animation: modalFadeIn 0.2s ease; } +.confirm-dialog.active { + display: flex; + opacity: 1; +} + .confirm-dialog-content { background: white; border-radius: 16px; diff --git a/static/js/contextMenus.js b/static/js/contextMenus.js index e8e64fe5..9d5f4fed 100644 --- a/static/js/contextMenus.js +++ b/static/js/contextMenus.js @@ -70,13 +70,11 @@ const contextMenus = { }); document.getElementById('delete-folder-option').addEventListener('click', async () => { - if (window.app.contextMenuTargetFolder) { - await window.fileOps.deleteFolder( - window.app.contextMenuTargetFolder.id, - window.app.contextMenuTargetFolder.name - ); - } + const folder = window.app.contextMenuTargetFolder; window.ui.closeContextMenu(); + if (folder) { + await window.fileOps.deleteFolder(folder.id, folder.name); + } }); // File context menu options @@ -174,13 +172,11 @@ const contextMenus = { }); document.getElementById('delete-file-option').addEventListener('click', async () => { - if (window.app.contextMenuTargetFile) { - await window.fileOps.deleteFile( - window.app.contextMenuTargetFile.id, - window.app.contextMenuTargetFile.name - ); - } + const file = window.app.contextMenuTargetFile; window.ui.closeFileContextMenu(); + if (file) { + await window.fileOps.deleteFile(file.id, file.name); + } }); // Rename dialog events