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.

refactor: update ytdlp status handling in layout component

Tonho8240f1b6bf04
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index a1ce0b98..9b65c14b 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -3,7 +3,6 @@
import { page } from "$app/state";
import { goto } from "$app/navigation";
import { onMount } from "svelte";
- import { invoke } from "@tauri-apps/api/core";
import { initDownloadListener } from "$lib/stores/download-listener";
import { getCounts } from "$lib/stores/download-store.svelte";
import { getSettings } from "$lib/stores/settings-store.svelte";
@@ -15,11 +14,12 @@
import ChangelogDialog from "$components/dialog/ChangelogDialog.svelte";
import OnboardingWizard from "$components/onboarding/OnboardingWizard.svelte";
import { needsOnboarding } from "$lib/stores/onboarding-store.svelte";
+ import { isYtdlpAvailable, isDepsChecked, refreshYtdlpStatus } from "$lib/stores/dependency-store.svelte";
import { t } from "$lib/i18n";
import type { Snippet } from "svelte";
- let ytdlpMissing = $state(false);
let ytdlpDismissed = $state(false);
+ let ytdlpMissing = $derived(isDepsChecked() && !isYtdlpAvailable());
let showOnboarding = $derived(needsOnboarding());
async function openAuthorGithub(e: Event) {
@@ -49,7 +49,7 @@
initDownloadListener().then((fn) => (cleanup = fn));
refreshUpdateInfo();
initChangelog();
- invoke<boolean>("check_ytdlp_available").then((ok) => { ytdlpMissing = !ok; }).catch(() => {});
+ refreshYtdlpStatus();
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
const handleChange = () => {