diff --git a/src/renderer/src/hooks/use-feature.ts b/src/renderer/src/hooks/use-feature.ts index 463cfc36..d601eae6 100644 --- a/src/renderer/src/hooks/use-feature.ts +++ b/src/renderer/src/hooks/use-feature.ts @@ -4,6 +4,7 @@ enum Feature { CheckDownloadWritePermission = "CHECK_DOWNLOAD_WRITE_PERMISSION", Torbox = "TORBOX", Nimbus = "NIMBUS", + NimbusPreview = "NIMBUS_PREVIEW", } export function useFeature() { diff --git a/src/renderer/src/pages/game-details/modals/repacks-modal.tsx b/src/renderer/src/pages/game-details/modals/repacks-modal.tsx index 5b225380..d38c7856 100644 --- a/src/renderer/src/pages/game-details/modals/repacks-modal.tsx +++ b/src/renderer/src/pages/game-details/modals/repacks-modal.tsx @@ -14,7 +14,7 @@ import { DownloadSettingsModal } from "./download-settings-modal"; import { gameDetailsContext } from "@renderer/context"; import { Downloader } from "@shared"; import { orderBy } from "lodash-es"; -import { useDate } from "@renderer/hooks"; +import { useDate, useFeature } from "@renderer/hooks"; import "./repacks-modal.scss"; export interface RepacksModalProps { @@ -58,7 +58,13 @@ export function RepacksModal({ return match ? match[1].toLowerCase() : null; }; + const { isFeatureEnabled, Feature } = useFeature(); + useEffect(() => { + if (!isFeatureEnabled(Feature.NimbusPreview)) { + return; + } + const magnets = repacks.flatMap((repack) => repack.uris.filter((uri) => uri.startsWith("magnet:")) ); @@ -66,7 +72,7 @@ export function RepacksModal({ window.electron.checkDebridAvailability(magnets).then((availableHashes) => { setHashesInDebrid(availableHashes); }); - }, [repacks]); + }, [repacks, isFeatureEnabled, Feature]); const sortedRepacks = useMemo(() => { return orderBy(