Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

fix: implement getBadgeCount function to count active downloads

Tonhof7958ccb103f
diff --git a/src/lib/stores/download-store.svelte.ts b/src/lib/stores/download-store.svelte.ts
index 9a8cef86..f4413251 100644
--- a/src/lib/stores/download-store.svelte.ts
+++ b/src/lib/stores/download-store.svelte.ts
@@ -59,6 +59,14 @@ export function getQueuedCount(): number {
return count;
}
+export function getBadgeCount(): number {
+ let count = 0;
+ for (const item of downloads.values()) {
+ if (item.status === "downloading" || item.status === "queued") count++;
+ }
+ return count;
+}
+
export function getPausedCount(): number {
let count = 0;
for (const item of downloads.values()) {