From ac0e5e692717fef0d7e21dd07f5715da88b3c5eb Mon Sep 17 00:00:00 2001 From: Astrid Date: Wed, 27 Dec 2023 22:39:38 +0100 Subject: [PATCH] Add support for playlist download --- src/components/player/atoms/settings/SettingsMenu.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/player/atoms/settings/SettingsMenu.tsx b/src/components/player/atoms/settings/SettingsMenu.tsx index 6e1f4d2f..14b3827f 100644 --- a/src/components/player/atoms/settings/SettingsMenu.tsx +++ b/src/components/player/atoms/settings/SettingsMenu.tsx @@ -37,6 +37,8 @@ export function SettingsMenu({ id }: { id: string }) { const source = usePlayerStore((s) => s.source); + const downloadable = source?.type === "file" || source?.type === "hls"; + return ( @@ -58,12 +60,10 @@ export function SettingsMenu({ id }: { id: string }) { - router.navigate( - source?.type === "file" ? "/download" : "/download/unable", - ) + router.navigate(downloadable ? "/download" : "/download/unable") } rightSide={} - className={source?.type === "file" ? "opacity-100" : "opacity-50"} + className={downloadable ? "opacity-100" : "opacity-50"} > {t("player.menus.settings.downloadItem")}