fix move
This commit is contained in:
@@ -189,12 +189,21 @@ export class ModalManager {
|
||||
});
|
||||
}
|
||||
|
||||
showMoveModal(filename, path) {
|
||||
showMoveModal(fileId, path) {
|
||||
console.log('[ModalManager] Showing move modal for file:', { fileId, path });
|
||||
document.getElementById('moveError').textContent = '';
|
||||
|
||||
// Set the file to move in the FileManager
|
||||
this.roomManager.fileManager.fileToMove = fileId;
|
||||
this.roomManager.fileManager.fileToMovePath = path;
|
||||
|
||||
console.log('[ModalManager] Set fileToMove:', this.roomManager.fileManager.fileToMove);
|
||||
console.log('[ModalManager] Set fileToMovePath:', this.roomManager.fileManager.fileToMovePath);
|
||||
|
||||
fetch(`/api/rooms/${this.roomManager.roomId}/folders`)
|
||||
.then(r => r.json())
|
||||
.then(folders => {
|
||||
console.log('[ModalManager] Fetched folders:', folders);
|
||||
const select = document.getElementById('moveTargetFolder');
|
||||
select.innerHTML = '<option value="">Root Folder</option>';
|
||||
|
||||
@@ -216,11 +225,12 @@ export class ModalManager {
|
||||
select.innerHTML += `<option value="${folderPath}">${indent}${displayName}</option>`;
|
||||
});
|
||||
|
||||
console.log('[ModalManager] Showing move modal');
|
||||
this.moveModal.show();
|
||||
})
|
||||
.catch(error => {
|
||||
document.getElementById('moveError').textContent = 'Failed to load folders.';
|
||||
console.error('Error loading folders:', error);
|
||||
console.error('[ModalManager] Error fetching folders:', error);
|
||||
document.getElementById('moveError').textContent = 'Failed to load folders. Please try again.';
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user