From 874f65f49f8b02f1db1339745de41426535afa2d Mon Sep 17 00:00:00 2001 From: Matthias Blankertz Date: Tue, 6 Jan 2026 12:37:31 +0100 Subject: [PATCH] fix[frontend]: Reset upload UI elements, don't expand tree view - Make sure the upload progess bar and file choser are reset when loading the file browser screen. - Don't expand the directories in the tree view by default. Signed-off-by: Matthias Blankertz --- software/frontend/index.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/software/frontend/index.html b/software/frontend/index.html index 0a74d1a..e05bc11 100644 --- a/software/frontend/index.html +++ b/software/frontend/index.html @@ -796,6 +796,10 @@ async function onShow(intent) { document.getElementById('playlist-filebrowser-addtrack').disabled = true; + if (intent !== 'refresh') { + document.getElementById('playlist-filebrowser-upload-progress').value = 0; + document.getElementById("playlist-filebrowser-upload-files").value = ""; + } tree = document.getElementById("playlist-filebrowser-tree"); tree.innerHTML = "Loading..."; fetch('/api/v1/audiofiles') @@ -830,7 +834,6 @@ if (type === 'directory') { const nested = document.createElement('ul'); node.appendChild(nested); - node.classList.add('expanded'); parent.appendChild(node); return nested; } @@ -917,7 +920,7 @@ } if (donecount + 1 === totalcount) { // Reload file list from device - onShow(); + onShow('refresh'); } else { uploadFileHelper(totalcount, donecount + 1, destdir, files.slice(1)); } @@ -944,7 +947,7 @@ const saveRes = await fetch(`/api/v1/audiofiles?type=directory&location=${location}`, {method: 'POST'}); // Reload file list from device - onShow(); + onShow('refresh'); } async function deleteItems() { @@ -965,7 +968,7 @@ } } // Reload file list from device - onShow(); + onShow('refresh'); } let tree = (() => {