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.

feat: initialize download listener on component mount

Tonhobc6c2323da20
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 9a7685bb..dfe3ffd1 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -1,10 +1,18 @@
<script lang="ts">
import "../app.css";
import { page } from "$app/state";
+ import { onMount } from "svelte";
+ import { initDownloadListener } from "$lib/stores/download-listener";
import type { Snippet } from "svelte";
let { children }: { children: Snippet } = $props();
+ onMount(() => {
+ let cleanup: (() => void) | undefined;
+ initDownloadListener().then((fn) => (cleanup = fn));
+ return () => cleanup?.();
+ });
+
const nav = [
{ href: "/", label: "Home", icon: "home" },
{ href: "/downloads", label: "Downloads", icon: "downloads" },