diff --git a/app/static/js/filebrowser.js b/app/static/js/filebrowser.js index 9559c32..1bffa18 100644 --- a/app/static/js/filebrowser.js +++ b/app/static/js/filebrowser.js @@ -291,6 +291,9 @@ const FileBrowser = { const img = document.getElementById('gallery-image'); if (img.src && img.src.startsWith('blob:')) URL.revokeObjectURL(img.src); img.src = ''; + + // Refresh file list to reflect any renames + this.loadDirectory(this.currentPath); }, async displayGalleryImage(index) { @@ -474,9 +477,6 @@ const FileBrowser = { this.closeRenameModal(); this.showGalleryToast('File renamed', 'success'); - - // Refresh the file list in the background - this.loadDirectory(this.currentPath); } catch (error) { console.error('Error renaming file:', error); errorEl.textContent = error.message;