From e2c0114c50d711707d1785cdee193f42bab8b8e0 Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Sat, 15 Feb 2025 20:21:48 +0800 Subject: [PATCH] Reset selected folder on new download initiation; add conditional rendering for folder items in modal --- static/js/managers/DownloadManager.js | 3 ++- templates/components/modals.html | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/static/js/managers/DownloadManager.js b/static/js/managers/DownloadManager.js index 8ffd4027..aa606c3a 100644 --- a/static/js/managers/DownloadManager.js +++ b/static/js/managers/DownloadManager.js @@ -42,6 +42,8 @@ export class DownloadManager { this.versions = []; this.modelInfo = null; this.modelVersionId = null; + // Add this line to reset selectedFolder + this.selectedFolder = ''; // Reset selectedFolder when starting new download } async validateAndFetchVersions() { @@ -224,7 +226,6 @@ export class DownloadManager { throw new Error(await response.text()); } - const result = await response.json(); showToast('Download completed successfully', 'success'); modalManager.closeModal('downloadModal'); diff --git a/templates/components/modals.html b/templates/components/modals.html index 54d52d4c..57a5f194 100644 --- a/templates/components/modals.html +++ b/templates/components/modals.html @@ -55,9 +55,11 @@