fix trashing in rooms

This commit is contained in:
2025-05-28 13:45:32 +02:00
parent d77dcec068
commit 2a1b6f8a22
4 changed files with 130 additions and 81 deletions

View File

@@ -56,12 +56,29 @@ export class ModalManager {
}
showDeleteModal(filename, path = '') {
console.log('[ModalManager] Showing delete modal for:', { filename, path });
const fileNameEl = document.getElementById('deleteFileName');
const labelEl = document.getElementById('deleteConfirmLabel');
const confirmBtn = document.getElementById('confirmDeleteBtn');
if (fileNameEl) fileNameEl.textContent = filename;
if (labelEl) labelEl.textContent = 'Move to Trash';
// Store the file info in the FileManager
this.roomManager.fileManager.fileToDelete = {
name: filename,
path: path
};
// Set up the confirm button click handler
if (confirmBtn) {
confirmBtn.onclick = () => {
console.log('[ModalManager] Delete confirmed for:', { filename, path });
this.roomManager.fileManager.deleteFile(filename, path);
this.deleteModal.hide();
};
}
this.deleteModal.show();
}