Clear active profile downloads

This commit is contained in:
2026-05-07 21:59:43 -04:00
parent 7370ae14b9
commit 72b43974c3
2 changed files with 37 additions and 0 deletions
@@ -81,6 +81,13 @@ impl BrowserCore {
.ok_or_else(|| CoreError::DownloadTargetPathUnavailable { id: download_id.clone() })
}
pub fn clear_downloads_for_active_profile(&mut self) -> usize {
let active_profile_id = self.active_profile_id.clone();
let before_count = self.download_entries.len();
self.download_entries.retain(|entry| entry.profile_id() != &active_profile_id);
before_count - self.download_entries.len()
}
pub(super) fn visible_downloads(&self) -> Vec<DownloadEntry> {
self.download_entries
.iter()